轉自:http://www.cnblogs.com/cjxnor/p/6583138.html
打開:service ssh start
當我們安裝好ubuntu,用ssh遠程登錄時,會出現如下錯誤。
[c:\~]$ ssh 192.168.142.84
Connecting to 192.168.142.84:22...
Could not connect to '192.168.142.84' (port 22): Connection failed.
Type `help' to learn how to use Xshell prompt.
錯誤顯示,該IP地址的22端口連接失敗。
解決方法如下:
(1)關閉防火牆,執行sudo ufw disable
nii@nii:~$ sudo ufw disable
[sudo] password for nii:
Firewall stopped and disabled on system startup
(2)安裝OpenSSH,執行sudo apt-get install openssh-server openssh-client命令。
(3)執行netstat -tnl命令,查看22端口是否開通。
nii@nii:~$ netstat -tnl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 ::1:631 :::* LISTEN
倒數第二行可以看到22端口已經處於LISTEN狀態。
ssh遠程登錄服務器時提示‘Permission denied (publickey)‘的解決:http://www.linuxdiyf.com/linux/15699.html
Linux下SSH遠程連接服務慢解決方案:http://www.linuxdiyf.com/linux/12318.html
采用SSH遠程執行命令:http://www.linuxdiyf.com/linux/6110.html
Ubuntu下SSH遠程連接:http://www.linuxdiyf.com/linux/4436.html
