ubuntu默認並無安裝ssh服務,若是經過ssh連接ubuntu,須要本身手動安裝ssh-server。判斷是否安裝ssh服務,能夠經過以下命令進行:java
@-desktop:~$ ssh localhostubuntu
ssh: connect to host localhost port 22: Connection refusedssh
如上所示,表示沒有尚未安裝,能夠經過apt安裝,命令以下:spa
@-desktop:~$ sudo apt-get install openssh-server .net
系統將自動進行安裝,安裝完成之後,先啓動服務:excel
@-desktop:~$ sudo /etc/init.d/ssh start server
啓動後,能夠經過以下命令查看服務是否正確啓動htm
@-desktop:~$ ps -e|grep ssh blog
6212 ? 00:00:00 sshd get
@-desktop:~$ ps -e|grep ssh 6212 ? 00:00:00 sshd
如上表示啓動ok。注意,ssh默認的端口是22,能夠更改端口,更改後先stop,
而後start就能夠了。改配置在/etc/ssh/sshd_config下,以下所示。
@-desktop:~$ gedit /etc/ssh/sshd_config
# Package generated configuration file
# See the sshd(8) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Package generated configuration file
# See the sshd(8) manpage for details
# What ports, IPs and protocols we listen for
Port 22
最後,應該是鏈接的時候了。請看以下命令:
@-desktop:~$ ssh exceljava@192.168.158.129
@-desktop:~$ gedit /etc/ssh/sshd_config
第二步:
在window上下載安裝secureCRT。
注意1.屬性設置ssh2
參考: