Re: ssh / keyless login problem

From: Darren Tucker (dtucker_at_zip.com.au)
Date: 07/26/05

  • Next message: Malden Male: "sftp redirect to common folder"
    Date: Tue, 26 Jul 2005 11:58:44 +1000
    To: SA <n0td1scl0s3d@ntlworld.com>
    
    

    SA wrote:
    [...]
    > The first time the script runs after a long delay (ie overnight when the local
    > host is turned off) ssh always asks for a password despite there being a
    > valid key pair on both hosts. If I kill the script and run it again then it
    > runs without asking for a password (as it should). My script needs to log in
    > several times and run automatically so password free operation is essential.
    >
    > I can't see why the first time fails - my only thought is that the remote
    > machine mounts my home directory over NFS and maybe this causes a problem?

    NFS should not be a problem, but maybe if your home directory is
    auto-mounted and there is some kind of delay in that process?

    > Does anyone have any suggestions as to:
    >
    > How I might solve this problem?
    > How I might diagnose it? (it is hard to repeat it more than once a day)
    > How I might stop ssh from asking for a password and return an error instead?
    > (in which case I can get my script to handle this exception with a dummy
    > login).

    Set the server to LogLevel DEBUG3 and wait for it to happen again, then
    look in the syslog to see what happened.

    > Any other suggestions?

    Tell the client to use only pubkey auth ("ssh -o
    PreferredAuthentications=publickey ...") and put a sleep-and-retry or
    two into your script.

    -- 
    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.
    

  • Next message: Malden Male: "sftp redirect to common folder"

    Relevant Pages

    • ssh / keyless login problem
      ... OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090701f ... I am using rsync to backup my local host to a remote host over ssh. ... The first time the script runs after a long delay (ie overnight when the local ...
      (SSH)
    • Re: How to get ssh to work in a loop
      ... > script for the sun systems which was quite easy as you only need to ... Drop cat (useless use of this command). ... I believe other UNIX systems) is to continually ping if 'ping HOST' is ... Running multiple ssh calls to the same system in a loop ...
      (comp.unix.shell)
    • Re: How to get ssh to work in a loop
      ... The for loop scrambles stdin, which upset, ssh/rsh, I get around ths by ... > script for the sun systems which was quite easy as you only need to ... > mounted filesystem by ssh to HP host and then creating a file called ... > doing loads of ssh to each host. ...
      (comp.unix.shell)
    • Re: Hack attempts
      ... The machines from where these attempts come are already hacked: ... The script connecting on SSH with user test and guest is checking the ... SSH version and how the SSH reacts besides the plain version reply. ... I was on one hacking host because the rootkit on it - Fuck'it Rootkit ...
      (Fedora)
    • Re: how to logon to 30+ unix machines and put a job in background and logout automatically in a scri
      ... In article, Serge Dubrouski wrote: ... If you don't know anything about ssh, ... Start this script with e.g. ... The first time you run this, ...
      (comp.unix.shell)