If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > help with ssh

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-14-04, 09:41
hgwells3 hgwells3 is offline
Registered User
 
Join Date: Jul 2004
Posts: 6
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"
Reply With Quote
  #2 (permalink)  
Old 07-14-04, 11:30
deebee deebee is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On