ssh timeout

Darren Tucker dtucker at zip.com.au
Wed Mar 17 16:45:30 EST 2004


Steve Belt (rgpg70) wrote:
> I am wondering if there is any way I can get ssh to timeout (return) if 
> nothing is entered when prompted for a password?  I understand there is 
> a LoginGraceTime value that can be used in the sshd_config file, but 
> that still doesn't make ssh return (exit) when no password is ever 
> entered.  The command just hangs until a <return> is pressed.  Is there 
> any way to make it return after the LoginGraceTime limit has expired? 
> I am using ssh inside a script that cycles over several hosts.  If a 
> host does not have an updated authorized_keys file, it prompts for a 
> password.  The script then hangs while ssh waits for an answer.  I would 
> like ssh to return (exit) eventually so the script can continue.

(Assuming you're using OpenSSH since you crossposted to openssh-unix-dev)

You could use "ssh -o PreferredAuthentications=hostbased,publickey 
yourhost" so it won't try password or keyboard-interactive.

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
     Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.




More information about the openssh-unix-dev mailing list