一般Ubuntu都会默认安装openssh-client,但是没有安装openssh-server。
安装ssh服务器
sudo apt install openssh-server
![](https://img.haomeiwen.com/i17333398/764b09812cf2f3d9.png)
安装ssh客户端
sudo apt install openssh-client
![](https://img.haomeiwen.com/i17333398/47176b70efdf0f62.png)
配置ssh客户端,去掉PasswordAuthentication yes前面的#号,保存退出
sudo vi /etc/ssh/ssh_config
![](https://img.haomeiwen.com/i17333398/c501ebd746c5298c.png)
![](https://img.haomeiwen.com/i17333398/28d281685b2ee545.png)
配置ssh服务器,把PermitRootLogin prohibit-password改成PermitRootLogin yes,保存退出。
重启ssh服务
sudo /etc/init.d/ssh restart
![](https://img.haomeiwen.com/i17333398/eb9a7ef56d7e0052.png)
网友评论