Ubuntu 为 root 帐号开启 SSH 登录

1. 修改 root 密码
sudo passwd root

 

2. 以其他账户登录,通过 sudo nano 修改 /etc/ssh/sshd_config :
xxx@ubuntu:~$ su - root

root@ubuntu:~# vi /etc/ssh/sshd_config

3. 注释掉 #PermitRootLogin without-password,改为  PermitRootLogin yes
# Authentication:

LoginGraceTime 120

PermitRootLogin yes

StrictModes yes

4. 重启 ssh 服务
root@ubuntu:~# sudo service ssh restart

ssh stop/waiting

ssh start/running, process 1499

root@ubuntu:~#

posted @ 2016-09-09 17:36  xie仗剑天涯  阅读(487)  评论(0编辑  收藏  举报