The error message for enabling the sshd service ssh localhost in centos is ssh: connect to host localhost port 22: Connection refused. One major cause is that the sshd service is not started, start the sshd service first, then there is no problem: www.2cto.com 1. Check whether the card service enables ps-ef | grep ssh 2. If not, install yum install openssh-server 3. After installation enable/etc/init. d/sshd start If/etc/init. d/sshd start: Generating SSH1 RSA host key: [FAILED] www.2cto.com solution: $ yum search openssh $ sudo yum install openssh $ sudo sshd ser Vice start sshd re-exec requires execution with an absolute path [honki @ localhost ~] $ Sudo service sshd start Generating SSH1 RSA host key: [OK] Generating SSH2 RSA host key: [OK] Generating SSH2 DSA host key: [OK] Starting sshd: [OK] 4. Disable/etc/init if the firewall still cannot be connected. d/iptables stop.