|
Secure Shell
Re: Returned post for secureshell (at) securityfocus (dot) com [email concealed] Apr 19 2010 01:16PM Jannik Sundø (jannik sundo sohonet co uk) (2 replies) Re: Returned post for secureshell (at) securityfocus (dot) com [email concealed] Apr 20 2010 01:44AM Derek Martin (code pizzashack org) (2 replies) Re: Returned post for secureshell (at) securityfocus (dot) com [email concealed] Apr 21 2010 12:12PM Jannik Sundø (jannik sundo sohonet co uk) Re: Returned post for secureshell (at) securityfocus (dot) com [email concealed] Apr 20 2010 08:18PM emf amhran net (1 replies) Re: Returned post for secureshell (at) securityfocus (dot) com [email concealed] Apr 21 2010 12:01PM Jannik Sundø (jannik sundo sohonet co uk) |
|
Privacy Statement |
> Hi all,
>
> 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 OpenSSH version 5.1p1 Debian-5, OpenSSL 0.9.8g 19 Oct 2007 on both client and server.
>
> I'm using this command:
>
> ssh root@IP -o PasswordAuthentication=no KbdInteractiveAuthentication=no
>
> This works for most servers, but not all (on some of them the script halts at a password prompt). I suspect those servers may run an older version of SSH which doesn't support the options I'm providing. Any ideas? Thanks for any help.
try
ssh root@IP -o PreferredAuthentications=publickey $command
And if you can write Perl, check also the Net::OpenSSH and
Net::OpenSSH::Parallel modules.
http://search.cpan.org/~salva/Net-OpenSSH-0.47/lib/Net/OpenSSH.pm
http://search.cpan.org/~salva/Net-OpenSSH-Parallel-0.06/lib/Net/OpenSSH/
Parallel.pm
- Salva
[ reply ]