Problem
How do I check to see if sshd is working? When I try to connect to the server the connection times out.
Solution
To check sshd is working correctly use the following steps:
1. Check networking is working to the server with the use of "ping" or "telnet".
2. Assuming you have a working network check using:
# ps -ef | grep sshdFor OpenServer, this should say "/etc/sshd". For UnixWare7, this should say "/usr/sbin/sshd".
If not, then the sshd daemon has not started for some reason.
It is started within /etc/rc2.d/S85tcp on OpenServer and /etc/rc2.d/S98opensshd on UnixWare7.
See "man sshd" for further information in starting the sshd daemon.
3. Assuming the sshd daemon is running, test locally to ensure the problem is not network related with:
# ssh localhostSee "man ssh" for further information.If no response is given then check that port 22 (the default port) is open with:
# netstat -an | grep 22We are expecting:tcp 0 0 *.22 *.* LISTENIf not, then the server is preventing port 22 from listening or you have configured sshd to listen on a different port and you should check the "sshd_config" configuration file.
See "man sshd_config" for further information.4. Assuming, that port 22 is open, test using:
# telnet localhost 22A successful connection will say:Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. SSH-1.99-OpenSSH_4.6
If not, then it's likely 'sshd' is trying to resolve it's name and is unable to.
Check the configuration of DNS and the server's local DNS configuration by:
# cat /etc/resolv.confto ensure that there is a valid configuration there.
See also
man ssh
man sshd
man sshd_config