[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

command line question.

Dmitrii PapaGeorgio

9/29/2003 9:45:00 PM

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.

4 Answers

gabriele renzi

9/29/2003 11:02:00 PM

0

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.

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..)

Rudolf Polzer

9/30/2003 12:07:00 AM

0

Scripsit ille &#187;Dmitrii PapaGeorgio&#171; <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&#246;rtlich wahr. Das ist verifizierbar und
&#252;berpr&#252;fbar. Das kannst du von der ''Physik'' der Physiker und
der ''Mathematik'' der Mathematiker nun wirklich nicht behaupten.
[Hans Joss in dsm]

Robert Klemme

9/30/2003 7:47:00 AM

0


"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

Dmitrii PapaGeorgio

9/30/2003 5:51:00 PM

0

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
>