感謝這篇文字的主人:http://asyty.iteye.com/blog/1440141
Ubuntu下測試ssh時使用ssh localhost 指令,出現錯誤提示connect to host localhost port 22:Connection refused
造成這個錯誤的原因可能是ssh-server未安裝或者未啟動。ubuntu 11.10 預設安裝openssh-client,但是木有安裝server
運作 ps -e | grep ssh,檢視是否有sshd程序
如果沒有,說明server沒啟動,通過 /etc/init.d/ssh -start 啟動server程序,如果提示ssh不存在 那麼就是沒安裝server
通過 sudo apt-get install openssh-server指令安裝即可