ubuntu Linux 开启root ssh登陆

 

 

ubuntu登录ssh的时候,默认情况下会出现如下问题:

xx@iMac-Pro ~ % ssh root@172.16.1.80 -p 21001
root@172.16.1.80's password: 
Permission denied, please try again.

主要是因为系统默认禁止root用户登录ssh,解决方法如下:

编辑sshd_config文件,root权限编辑:vi /etc/ssh/sshd_config

# Authentication:
LoginGraceTime 120    #时间自己把控即可,默认2m
#PermitRootLogin without-password
PermitRootLogin yes  #开启
StrictModes yes    #开启

 

接着我们需要重启ssh服务,输入:

 

/etc/init.d/ssh restart

 

posted on 2022-10-05 13:18  tonkai  阅读(315)  评论(0编辑  收藏  举报

导航

tonkai