1、Ubuntu 需要安装SSH服务器

sudo apt-get install openssh-server

2、启用root用户

sudo passwd -u root #解锁密码

sudo passwd root #设置密码

3、开启ssh下root登录

修改配置文件sshd_config中,进行编辑:vi /etc/ssh/sshd_config

找到PermitRootLogin 添加一行 PermitRootLogin yes,如下:

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
PermitRootLogin yes

保存退出后,重启ssh服务,输入命令: /etc/init.d/ssh restart

posted on 2021-10-28 11:09  啊哈咧  阅读(275)  评论(0编辑  收藏  举报