How do i find out if remote host is accepting ssh login?

Can someone suggest a reliable way to check if a remote host is
accepting ssh login?

thanks

Rick T. wrote in post #1060837:

Can someone suggest a reliable way to check if a remote host is
accepting ssh login?

Open TCP connection to remote host port 22. Read one line. Check you see
an SSH banner.

On 05/15/2012 12:15 PM, Brian C. wrote:

Rick T. wrote in post #1060837:

Can someone suggest a reliable way to check if a remote host is
accepting ssh login?

Open TCP connection to remote host port 22. Read one line. Check you see
an SSH banner.

It’s possible that the above test may be enough to satisfy the OP, but
the problem as stated is vague enough to leave some room for
interpretation. If you really need to know that login is going to
work, the only complete test is to actually perform a login via SSH with
known-good credentials.

The net-ssh gem will help in writing such a test pretty easily. :slight_smile:

-Jeremy