Command line question

i want to use ruby under UNIX for launching different apps under
different users. how would i implement something like this

let’s say i create/launch a shell command from ruby like

ssh user@local.com

this will prompt the user for a password, and i would like a string
variable to be executed when it prompts for the password.

I think you may look for expect (there is something on raa, but I cant
really remeber…)
It is aimed at interactive commands interazction (login,ftp,telnet…)

···

il Mon, 29 Sep 2003 21:45:16 GMT, Dmitrii PapaGeorgio vrenna@woh.rr.comNOSPAM ha scritto::

this will prompt the user for a password, and i would like a string
variable to be executed when it prompts for the password.

Scripsit ille »Dmitrii PapaGeorgio« vrenna@woh.rr.comNOSPAM:

ssh user@local.com

this will prompt the user for a password, and i would like a string
variable to be executed when it prompts for the password.

Generally you need something like expect. But that’s the wrong approach
in your special case. Better use SSH login via a public/private key
pair. You can create one with the ssh-keygen command on the client (I
normally use “ssh-keygen -t dsa” and perhaps some other options about
key length etc.). If the server is OpenSSH, you have to put the public
key (the one with .pub at the end of it’s name) as a line in the server’s
~/.ssh/authorized_keys. Then you should be able to do ssh user@local.com
without a password question - but only if you have the private key file
(so don’t give it away).

···


Die Bibel ist wortwörtlich wahr. Das ist verifizierbar und
überprüfbar. Das kannst du von der ‘Physik’ der Physiker und
der ‘Mathematik’ der Mathematiker nun wirklich nicht behaupten.
[Hans Joss in dsm]

“Dmitrii PapaGeorgio” vrenna@woh.rr.comNOSPAM schrieb im Newsbeitrag
news:MJ1eb.84012$xx4.10577106@twister.neo.rr.com

i want to use ruby under UNIX for launching different apps under
different users. how would i implement something like this

let’s say i create/launch a shell command from ruby like

ssh user@local.com

this will prompt the user for a password, and i would like a string
variable to be executed when it prompts for the password.

It’s not completely clear to me what you want. Do you want to execute a
program on the server side whenever a user logs in via SSH? Or do you
want to build a client side application that does SSH login and then
starts an application on the server?

robert

Actually I made up the example using ssh.

I have a lot of apps which asks for user id, password, host, etc. So I
wanted to know if there was something I could use…for an example.

id = “james”
pwd = “pwd”
host = “local”

have the code above launch to a specific system command like ssh

so when prompted for user id…vairable id would be sent, for pwd, etc.

Robert Klemme wrote:

···

“Dmitrii PapaGeorgio” vrenna@woh.rr.comNOSPAM schrieb im Newsbeitrag
news:MJ1eb.84012$xx4.10577106@twister.neo.rr.com

i want to use ruby under UNIX for launching different apps under
different users. how would i implement something like this

let’s say i create/launch a shell command from ruby like

ssh user@local.com

this will prompt the user for a password, and i would like a string
variable to be executed when it prompts for the password.

It’s not completely clear to me what you want. Do you want to execute a
program on the server side whenever a user logs in via SSH? Or do you
want to build a client side application that does SSH login and then
starts an application on the server?

robert