This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
 
Similar Threads
Current directory not in path when logging via ssh
problem running SSH with JSP
stored procedure
Callling a Script from a java program
Java program sshing to Linux Server