Re: Dead SSH Connections from script

From: Pete Nesbitt (pete_at_linux1.ca)
Date: 07/20/04

  • Next message: Duncan: "Re: IPCHAINS"
    To: General Red Hat Linux discussion list <redhat-list@redhat.com>
    Date: Mon, 19 Jul 2004 18:25:42 -0700
    
    

    On July 19, 2004 09:26 am, Richard Hobbs wrote:
    > Hello,
    >
    > This script is causing problems... for some reason it keeps leaving dead
    > SSH connections around, which actually caused the server to run out of file
    > handles, reporting (too many open files).
    >
    > Is there something wrong with the script??
    >
    > Thanks in advance to anyone who can help, here's the script:
    >
    > ======================================================================
    > #!/bin/csh -f
    >
    > set NPARAMS = 1
    > if ($#argv != $NPARAMS) then
    > echo "Usage: $0 <list of automount hosts>"
    > exit 1
    > endif
    > set HOSTLIST = $1
    > shift
    > set P1 = $1
    > set P2 = $2
    >
    > set FILENAME=/project2/remote/automountresults`date "+%Y%m%d%H%M%S"`.txt
    > echo Automount auto.rmt results > $FILENAME
    > foreach host (`cat $HOSTLIST`)
    > echo $host
    > echo $host >> $FILENAME
    > /usr/bin/scp /project2/remote/auto.rmt $host":/tmp/"
    > /usr/bin/scp /project2/remote/automountconfig $host":/tmp/"
    > /usr/bin/ssh root@$host /tmp/automountconfig >> $FILENAME
    > end
    > ======================================================================
    >
    > Thanks,
    > Hobbs.

    Hi,
    I am not too familiar with csh, but it appears to be fine.
    Are you using a key based authentication that works for the user that the
    script runs under? You could test by trying the scp line from the command
    line.
    How is roots password provided (or is it key?)
    Is root allowed to access the remote systems via ssh?

    -- 
    Pete Nesbitt, rhce
    -- 
    redhat-list mailing list
    unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    

  • Next message: Duncan: "Re: IPCHAINS"

    Relevant Pages

    • Logon script with SSH
      ... I am using this two files to run script when users Telnet the server ... Now, i installed OpenSSH 4. ... How can i use the same file for ssh connections? ...
      (comp.unix.solaris)
    • Logon script with SSH - Solaris 8
      ... I am using this two files to run script when users Telnet the server ... Now, i installed OpenSSH 4. ... How can i use the same file for ssh connections? ...
      (comp.security.ssh)