RE: SSH without inputing password

--- Gerrard Geldenhuis <Gerrard.Geldenhuis@xxxxxxxxxxxx> wrote:

You could use expect.
Here is an article on it...

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@xxxxxxxxxxx
expect -exact "username@xxxxxxxxxxx's passwd: "
send -- "password\r"

when you run the script, you do can login to the remote host
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

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.


Get the name you always wanted with the new y7mail email address.

redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe

Relevant Pages

  • Re: Hacker activity?
    ... >login to a server, most as root but some are attempts to login to ... >telnet, all come from the same remote server, and all fail. ... >getting some odd cgi calls to a script on a secure ssl server. ... Make sure root cannot login to your system via ssh. ...
  • Re: Detailed logging of ssh sessions
    ... >via ssh). ... come in some way from the login shell. ... I'd just experiment with using script in some way ...
  • Re: Authentication with SSH using public keys
    ... I use ssh to login remotely. ... Normally, I just copy, via scp, the file to my ~/.ssh/authorized_keys file on the remote host and the next time I attempt a login all is well. ... Now, I've looked through his /etc/ssh/sshd_config file and nothing in there looks odd, or different, from other remote hosts I do this on. ...
  • ssh / keyless login problem
    ... OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090701f ... I am using rsync to backup my local host to a remote host over ssh. ... The first time the script runs after a long delay (ie overnight when the local ...
  • Re: ssh read from remote host xx.xx.xx.xx:Connection reset by peer
    ... The script does SSH in a loop and every few ... Connection closed by remote host. ...