05.07.2011-----ssh: connect to host localhost port 22: Connection refused
[0]
http://www.baidu.com/baidu?wd=ssh:+connect+to+host+port+22:+Connection+refused&tn=cnopera&ie=utf-8
[1]
http://cache.baidu.com/c?m=9f65cb4a8c8507ed4fece7631046893b4c4380147d8c8c4668d4e419ce3b4c413037bfa6663f405a8e906b6075a81d57ecf33572300123b5998a831981ac925f75ce786a6459db0144dc58ee915124b1379129feaf68b6e7ac6ec4ff94c4df25159744050bdaadca1c1714bb2dad5477f4a6e848154811cafa3116e8590678c27f1ce116bfbb6f321081879d0b18846b8737&p=8c658f16d9c511a05eecd5625f53&user=baidu&fm=sc&query=ssh%3A+connect+to+host+port+22%3A+Connection+refused&qid=c95f51350e354bc4&p1=1
一般错误信息为:ssh: connect to host localhost port 22: Connection refused
这种错误很主要的一个原因是sshd服务没有启动,先启动sshd服务后就没有问题了。
启动sshd服务:netstart sshd (前提条件是你已安装过ssh了)
centos(service sshd start)
ssh localhost
或者防火墙阻止了sshd服务
ps:如果没有sshd,那么需要安装sshd。
[2]
一般是端口不对;比如默认是22;实际用了8022;