Ubuntu默認沒有安裝openssh-server包,故從遠程計算機經過SSH鏈接時會收到Connection refused的消息。ssh
首先在Ubuntu檢查/etc/ssh/sshd_config文件是否存在。測試
cat /etc/ssh/sshd_config
Ubuntu默認狀況下是不存在這個文件的。這時須要經過apt-get install安裝openssh-server。spa
apt-cache search ^openssh sudo apt-get install openssh-server
安裝完成以後,再測試便可。code