I have written a script that is expected to get a bunch of host names from some place and run a command on each of those hosts:
ssh "$host" some command
I have the necessary configuration to make ssh
connections without the need for a password. However, sometimes we encounter a host that does need a password and the script hangs.
Is there a way to make ssh time out while waiting for a password? I don't want to use the timeout
command.
Best Answer
You are looking for LoginGraceTime in your
sshd_config
.From
sshd_config(5)
: