how to check if sshd runs on a remote machine

Viewed 26435
ssh -q -o "BatchMode=yes" user@host "echo 2>&1" && echo "OK" || echo "NOK"

this method is suitable but it returns true when the pub.key is copied to host. I need to see if an ssh is connectiable between two devices without keys.

Simply wants to check if the sshd is running remotely.

1 Answers
Related