Problem scenario
You try to use PuTTY to connect to a Linux CentOS 6.x server. You get the message "Network error: Connection refused." What should you do?
Solution
Prerequisite
This assumes that there is no software or hardware firewall blocking port 22. You may want to use nmap or a Windows PowerShell port tester to verify port 22 is open. If iptables is blocking port 22, this will not work until you reconfigure iptables.
Procedures
- Go to the Linux CentOS server.
- Modify the /etc/ssh/sshd_config file. Make sure that the
"PasswordAuthentication" and "ChallengeResponseAuthentication" stanzas are set to yes. Make sure that they are not commented out (with a leading "#"). Make sure that the corresponding stanzas for "no" are commented out (with a leading "#"). - Run this command:
sudo service sshd restart
- If you want the ssh daemon to be listening upon every reboot, create a crontab entry with the root user like this:
@reboot /sbin/service sshd restart