BashScripts.org
http://bashscripts.org/forum/

ssh script
http://bashscripts.org/forum/viewtopic.php?f=15&t=828
Page 1 of 1

Author:  DanSandbergUCONN [ Tue Jun 23, 2009 1:37 pm ]
Post subject:  ssh script

Hi All - I'm trying to make a script where the user enters their username and password for a remote computer cluster and the script logs into the computer and does some stuff. Now.... I've done this successfully but needed to set up RSA keys on the desktop machine and computer clutster. Ultimately i plan to use extended basic to create a GUI to run this script and then I plan on distributing the GUI. Because I'm distributing the GUI I obviously cant set up RSA keys for all possible machines and because the GUI runs the script is can't be interactive. Is there any other was to ssh into the cluster using the password as an argument of the script? Essentially I need a one-liner linux bash command to ssh into the cluster and automatically enter the password. I thought maybe

ssh [email protected] | password

would work but no such luck. Any help is much appreciated.

Author:  thobbs [ Tue Jun 23, 2009 11:28 pm ]
Post subject:  Re: ssh script

I'm not sure I perfectly understand your situation, but as far as using ssh-keygen, you don't want to use that because users will need to login to the cluster computers from, say, a public or home machine where storing the key isn't feasible/secure? Otherwise, it would be quite easy to do that.

Unfortunately, I cannot think of any easy one-liner way to supply a password to ssh, and the best info I found on line was this: http://nixcraft.com/shell-scripting/4489-ssh-passing-unix-login-passwords-through-shell-scripts.html. It's a bit of work, but it could do what you want. If you want to implement that and need any help, just let us know.

On the other hand, would it really be so bad to have a shell pop up and prompt for a password?

Author:  jeo [ Thu Jul 23, 2009 12:27 pm ]
Post subject:  Re: ssh script

Perl has an ssh library that allows you to put the user/pass into the script. Using keys is the only bash option I can think of, unless you want to script it in somthing like 'expect'.

Page 1 of 1 All times are UTC - 6 hours
© 2000, 2002, 2005, 2007 phpBB Group • http://www.phpbb.com