每当安装完成一次Ubuntu系统,都无法使用root帐号通过ssh登录,只能先通过其他的用户登录系统,然后配置root帐号,然后登录。
安装完系统后,执行ssh的安装操作,因为有可能版本不一致
执行 sudo apt-get install ssh
然后打开ssh的配置文件 vi /etc/ssh/sshd_config
将PermitRootLogin without-password注释掉
添加 PermitRootLogin yes
# Authentication:
LoginGraceTime 120
#PermitRootLogin without-password
PermitRootLogin yes
StrictModes yes
重启ssh服务即可
root@ubuntu:/# sudo service ssh restart
ssh stop/waiting
ssh start/running, process 4059</span>
转载请注明原文地址: https://ju.6miu.com/read-1298521.html