Forums Register Login

ssh from script

+Pie Number of slices to send: Send
Hi,
I am writing a simple script to ssh to a another machine and execute some command

#!/usr/bin/ksh

ssh -l <hostip> << EOF
password
ls
EOF

but when I execute the script I am getting the following message

"Pseudo-terminal will not be allocated because stdin is not a terminal." an d I am asked to enter the password on the prompt..

Any idea how this could be resovled.

Thanks
+Pie Number of slices to send: Send
My manpage tells me lot of possibilities to handle login via /etc/hosts.equiv, ~/.shosts, /etc/ssh/... or other config-files.

(none of them seems to work for me )
What are your superhero powers? Go ahead and try them on this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 910 times.
Similar Threads
Callling a Script from a java program
Java program sshing to Linux Server
stored procedure
Current directory not in path when logging via ssh
problem running SSH with JSP
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 23:50:39.