Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to connect to a solaris server using putty from a windows client. SSH connection is not working. The terminal window just gives an error message "Network error:Connection refused". Telnet using putty is working fine with the same server. Can someone please detail what configurations needs to be checked in this case? How to troubleshoot? (There are other servers in the same network which allows SSH connection.)

share|improve this question
add comment

6 Answers

up vote 5 down vote accepted

Here is a series of steps you can use to diagnose the problem:

  1. Check if sshd is running on the host(ps -ef|grep ssh)
  2. Ensure that sshd is binding to port 22 using netstat (netstat -al|grep "LISTEN " should work)
  3. See if you can connect to the real IP address via ssh from the host machine (if not, there is either a local firewall, or sshd is not working as it should
  4. Try to ping the host from the client machine (if this fails, there is a routing problem)
  5. Try to telnet to port 22 from the client machine (telnet 192.168.1.1 22) (if this fails, a firewall is blocking you)
  6. Finally, if all the above succeed, but you cannot ssh using the ssh client - re-install your ssh client.
share|improve this answer
add comment

If this is Solaris 10, check if SSHD is running by issuing the svcs -p ssh command. That'll tell you if SSH is running, and, if not, why (maybe a dependancy failed for some reason, or maybe it was disabled).

You can enable SSH by issuing svcadm enable ssh

share|improve this answer
    
It is solaris 5.8 –  user10090 Jun 19 '09 at 12:54
    
In that case you can't use services. I would refer to the other answers (using ps -ef | grep sshd to check the process; netstat -a to check the port, etc.) to verify it's running. If it's not, track down where it should be started from (probably rc2.d or rc3.d, or part of the inetd startup). Also check your /var/adm/messages and /var/log/syslog files to see if SSHD attempted to start and caught an error. That could explain why it's not running. –  Milner Jun 19 '09 at 13:10
add comment

If you confirm ssh is running on the machine, you may want to check if the client machine you're trying to connect from can see port 22 as open using nmap.

nmap -p22 [solaris-box-ip]

share|improve this answer
add comment

I know it seems a very obvious check. But have you confirmed that your Solaris server has a sshd running? Once you have telneted to the machine run netstat to see if it is listening on the ssh port (port 22). If it is then you next port of call will be to check /etc/hosts.allow and so forth as MathewC suggested

share|improve this answer
add comment

Check if there isn't a firewall between you and the server.

share|improve this answer
add comment

Connection refused means the service is running but you don't have access.

Check /etc/hosts.allow

You might need to also run

inetadm -m network/telnet:default tcp_wrappers=TRUE

share|improve this answer
    
/etc/hosts.allow file is not present in any of the servers here(other servers which allows ssh connection also doesnt have this file). –  user10090 Jun 19 '09 at 12:44
    
Connection refused also means that the service is not running (and there is no firewall dropping the packets silently). –  pauska Jun 19 '09 at 12:55
    
hmm, I thought that would show as a timeout instead of an instant refusal. –  MathewC Jun 19 '09 at 13:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.