ubuntu - meetbill/op_practice_book GitHub Wiki

ubuntu 常见问题

ssh无法登陆

ubuntu-14.04.5-server版本。

解决办法:

(1)关闭Ubuntu14.04的防火墙

root@meetbill:~# sudo ufw disable

防火墙在系统启动时自动禁用

(2)Ubuntu系统上安装、启动sshd服务

sudo apt-get install openssh-server
sudo /etc/init.d/ssh restart  

使用root进行远程登陆

(1)修改 root 密码

sudo passwd root

(2)修改 /etc/ssh/sshd_config :

meetbill@ubuntu14:~$ su - root
Password:
root@ubuntu14:~# vi /etc/ssh/sshd_config

(3)注释掉 #PermitRootLogin without-password,添加 PermitRootLogin ye

[...]
#PermitRootLogin without-password
PermitRootLogin yes
[...]

(4)重启 ssh 服务

root@ubuntu14:~# sudo service ssh restart
ssh stop/waiting
ssh start/running, process 1543
root@ubuntu14:~#