[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ssh and stuff



On Wed, Feb 09, 2000 at 07:18:16PM +1100, Andrew wrote:
> Is it possible to get ssh to run a command on a remote machine from
> another script?  I've tried doing things like:
> 
> ssh host 'command' -l user <<EOF
> password
> EOF
> 
> but I just can't seem to get it to work.  Is it possible?

no idea on passwords from stdin, the next poster says it cannot be
done that way..

however depending on your situation you could use RSA authentication
instead, this however requires that the private RSA key have no
passphrase so it must be well protected or the target account can be
easily compromised.  

I did this so my UPS shutdown script sshs into a special account on a
second machine which shuts it down (via sudo) the command line i used
in the script is:

/usr/bin/ssh -i /some/path/.ssh/identity -n targethostname

the -n means input from /dev/null

but again make sure that identity file is WELL protected. 

-- 
Ethan Benson


Reply to: