On Feb 8, 2005, at 9:05 AM, shogunx wrote:
On Tue, 8 Feb 2005, James Melin wrote:
try netcat.
Got a question about ssh....
rexec provides an ability to execute a command on a remote system and pass the ID/Password on the command line. This prevents the session from prompting for a password.
e.g: rexec -l username -p password hostname command
the problem with rexec , of course, is that it is unsecure.
ssh also allows command line invocation of a command on a remote system. This is good, in that it will do the authentication encrypted. What I do not know is how to do it all nice and neat from a script without being challenged for a password.
What I am looking to do is to ssh to a specific linux, execute a command, capture the output of that command, parse that output and set some variables and write out a 'status page' html file. I do not know how to handle being asked for a password in a shell script.
I've seen some stuff about the identity file, but that really isn't making sense to me either and certainly seems like overkill for what I'm doing.
Netcat won't help you here, because it doesn't execute anything on the remote system (however, you should install it and play with it some; it's a fantastically useful debugging tool for those times when the telnet negotiation bits are screwing you up).
SSH with key-based authentication is what you want. Generate a key pair on the driving system with no password. Then put the public key of that pair into authorized_keys onto the target system. Then from a userid that can point to the private key on the driving system, ssh with that key as the "identity". It's not really all that hard.
And I see that Peter Oberparleiter has already given detailed instructions on how to do this, so I won't.
Adam
---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390
