使用X-shell管理员root连接ubuntu17.10服务器拒绝密码的一个失误!

使用X-shell连接ubuntu的本来正常的,后来因为是非root登入都是正常,采用root登入的时候出现拒绝

修改的方法也是跟网上的技术文件是一样的,方法如下:

修改:

已经开启root登入,所有没有加sudo命令

vim /etc/ssh/sshd_config

找到:

# Authenticaton

LoginGraceTime 120

PremitRootLogin without passwd   //很多人都说注示这一条,可能是版本的不同吧

StrictModes yes

 

修改为:

# Authenticaton

LoginGraceTime 120

PremitRootLogin yes        

StrictModes yes

然后重启ssh服务:

# /etc/init.d/ssh restart

至这一部后以为一切正常的,但是登入的时候还是提示密码拒绝

再次回到vim /etc/ssh/sshd_config查看

发现一个小细节

# Authenticaton

#LoginGraceTime 120

#PremitRootLogin without passwd   

#StrictModes yes

全部是注释的状态,将后面三条改成未注释状态,登入成功。

posted @ 2018-02-05 16:48  张小小先生啊  阅读(442)  评论(0编辑  收藏  举报