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命令安裝即可