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…)
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]
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?
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?