在ubuntu系统中,默认是不开启ssh使用root用户登陆的,在/etc/ssh/sshd_config配置文件中如下配置:
# Authentication:
LoginGraceTime 120
PermitRootLogin without-password
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
很多时候需要允许root用户登陆,需要将PermitRootLogin without-password修改为PermitRootLogin yes.然后重启ssh,sudo service ssh restart.这样就可以使用root用户登陆了!配置如下:
# Authentication:
LoginGraceTime 120
#PermitRootLogin without-password
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes