Re: Returned post for secureshell@xxxxxxxxxxxxxxxxx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Mon, Apr 19, 2010 at 02:16:46PM +0100, Jannik Sundø wrote:
>> I'm writing a script which will log into a list of servers if they
>> have public/private keypairs set up. If a server doesn't, I want the
>> script to move on to the next server rather than wait at a password
>> prompt.
>>
>> I'm using this command:
>> ssh root@IP -o PasswordAuthentication=no KbdInteractiveAuthentication=no

Found elsewhere on the web and modified.... in bash,

( ssh root@IP -o PasswordAuthentication=no KbdInteractiveAuthentication=no
) & sleep 5 ; kill $!

Assuming whatever you're doing on the list of servers will take 5 seconds
to complete and continue.. if not, replace the 5 in the sleep with however
long it will take to complete the task.

If it hangs at a password prompt, it'll only hang for the sleep timer and
then continue on.

[Index of Archives]     [Open SSH Unix Development]     [Fedora Users]     [Fedora Desktop]     [Yosemite Backpacking]     [KDE Users]     [Gnome Users]

  Powered by Linux