SSH without inputing password

tech user techwww at yahoo.com.cn
Tue May 20 14:15:30 UTC 2008


--- Gerrard Geldenhuis <Gerrard.Geldenhuis at datacash.com> wrote:

> You could use expect.
> Here is an article on it... 
> http://www.linuxjournal.com/article/3065
> 

first, thanks for all replies.
but, expect is also not what I wanted.
why? because expect can't let you stay in remote host for long time.

for example, you say something like this in an expect script:

spawn ssh username at 12.34.56.78
expect -exact "username at 12.34.56.78's passwd: "
send -- "password\r"

when you run the script, you do can login to the remote host
automatically.
But, you can't do anything.
Even you input an "enter", you will get exited automatically.
I don't know why, but this is the fact.

generally expect do some automatical tasks, but not keep a persistent ssh
connection.

This is what expect can do:

1> logins into a machine
2> executes a program
3> logs out of the machine

But what I wanted is:

1> ssh remote_host
2> input password automatically for me
3> let me login into it successfully and stay there

Do you know me? Thank you.

--Ken





      Get the name you always wanted with the new y7mail email address.
www.yahoo7.com.au/y7mail





More information about the redhat-list mailing list