aspose file tools*
The moose likes Linux / UNIX and the fly likes ssh from script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "ssh from script" Watch "ssh from script" New topic
Author

ssh from script

Satish Kulkarni
Ranch Hand

Joined: Jul 19, 2003
Posts: 60
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
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

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 )


http://home.arcor.de/hirnstrom/bewerbung
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ssh from script