passwordless ssh without ssh-key handshaking

371 Views Asked by At

I have 100 machines to be automatically controlled using passwordless ssh. However, since passwordless ssh requires id_rsa handshaking, it takes some time for controlling a machine as we can see in the following.

$ time ssh remote hostname
remote

real    0m0.294s
user    0m0.020s
sys     0m0.000s

It takes approximately 0.3 seconds, and doing this all over 100 machines takes around 30 seconds. What I'm looking for is to make the account on the remote machine no password at all. Is there a way to do it?

3

There are 3 best solutions below

0
On

The delay may be caused by the host doing a reverse DNS lookup when the client connects, to verify that the client's hostname reverses to the same IP that the client is connecting from. If you disable this option on your server's sshd, you may see less delay when connecting. See the links below for more info:

http://linux-tips.org/article/92/disabling-reverse-dns-lookups-in-ssh https://unix.stackexchange.com/questions/56941/what-is-the-point-of-sshd-usedns-option

0
On

There is a way: use telnet. It provides the same as ssh without authentication and encryption.

1
On

You can try using sshpass

For example, when password is in password.txt file:

sshpass -fpassword.txt ssh username@hostname