Results 1 to 2 of 2

Thread: help with ssh

  1. #1
    Join Date
    Jul 2004
    Posts
    6

    Unanswered: help with ssh

    When I run this script, I am prompted for the password for the remote machine, but then the program just sits there? I have to press ctrl-c to get the program to finish (it works properly). Any ideas on what is wrong?

    ssh 10.191.21.2 "more /.rhosts | grep machine_1 >tmpfile
    if [ -s "tmpfile" ]
    then
    echo "" >/dev/null
    else
    echo "10.191.21.2 root" >>/.rhosts
    fi
    rm tmpfile"

  2. #2
    Join Date
    Jul 2004
    Posts
    45
    I guess (I have tried with my IP but there was some prob. while connecting but this worked for FTP), you will have to use the block(here I used ENDSCRIPT) for your script. like ...
    ssh 10.191.21.2 <<ENDSCRIPT
    more /.rhosts | grep machine_1 >tmpfile <<
    if [ -s "tmpfile" ]
    then
    echo "" >/dev/null
    else
    echo "10.191.21.2 root" >>/.rhosts
    fi
    rm tmpfile
    ENDSCRIPT

    ..try this way. might work but not sure

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •