ssh: connect to host 192.168.58.129 port 22: Connection refused
1. 查看ssh服務端有沒有安裝html
ps -e|grep ssh
若是出現了sshd
,則表示已經安裝ssh服務端,不然須要自行安裝vim
2. 安裝ssh服務端ssh
apt-get install openssh-server
3. 啓動服務端程序code
/etc/init.d/ssh start
詳細信息請參考:http://www.javashuo.com/article/p-ylyfnqok-go.htmlserver
出現以下問題:
這是因爲ssh server端未賦予權限htm
1. 打開ssh的配置文件blog
vim /etc/ssh/sshd_config
2. 對配置文件作以下修改
將以下一行get
PermitRootLogin prohibit-password
改爲:虛擬機
PermitRootLogin yes #prohibit-password
3. 若是一樣想 `ssh root@x.x.x.x
將以下一行:it
#UserLogin yes
改爲:(即去掉註釋)
UserLogin yes
4. 最後效果: