Re: Returned post for secureshell@securityfocus.com



This worked, thanks a lot! :)


On 20 Apr 2010, at 10:23, Salvador Fandino wrote:

On 04/19/2010 03:16 PM, Jannik Sundø wrote:
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.

Jannik


try

ssh root@IP -o PreferredAuthentications=publickey $command


- Salva



Jannik Sundø
Junior Network Engineer
Sohonet Limited http://www.sohonet.co.uk
Registered no. 3132110 England/Wales
t: +44 (0)20 7292 6900
f: +44 (0)20 7292 6901

24/7 support:
UK: +44 (0)20 7292 6909
US: +001 310 449 8610
AU: 1800 77 5280

The information in this email may contain confidential and/or privileged material. Any copying, dissemination or other use by any person other than the intended recipient is prohibited. If you have received this email in error, please contact the sender and delete the material from your computer. Thank you.



Relevant Pages

  • Re: Learning Expect - Some help with a straightforward script + advice on cleaner ways to do thi
    ...  This is the first script of a few to go across multiple servers, but basically I have a very, very, very outdated hosts file that needs to be updated, as well as servers whose ... This script is used to ensure servers are up and running. ... # Need a way to check for an ssh time out/hang on connect ... # - Checking if the ssh session is connecting and then getting term'd ...
    (comp.lang.tcl)
  • Re: User Administration Script?
    ... > I will be responsible for user administration on about 100 identical Netra ... All servers will have the same users. ... > Bourne type script that will loop through all the servers running a subshell ... I believe that you will find that ssh is your friend in taking on this task. ...
    (comp.unix.solaris)
  • Re: Enforce SSH Login Delay
    ... These are automated attacks from servers, ... discover generic SSH usernames with unsecured login passwords. ... script to scan my secure logs every few minutes and block the IPs automatically. ... Below is the source code to the script noted. ...
    (comp.os.linux.misc)
  • Re: Deny rules...
    ... services client I have not implemented it. ... Tony Su ... >The Script makes sure the ip to be blocked is not itīs ... >I have few outside servers to connect from to my servers ...
    (microsoft.public.isa)
  • Re: Software configuration management tool required
    ... If it automates ... and 100-ish servers, it's just not going to happen. ... you test it by running the rc?.d script that init will ... > because Oracle or some vendor tells them to do so. ...
    (comp.unix.admin)