Re: how to give password for ssh connection from shell script]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hello.

Use expect. Some quick example:


set username "user"
set password "somepass"


########

  spawn ssh 111.222.222.111 -l $username
  expect "assword:"
  send "$password\r"
  expect "#"
  send "whatever command to execute"
  expect "#"
  send "exit\r"

Regards,

naslov

Krishnaprasad wrote:
Hi all

how can i give password for a ssh connection from shell script. I dont want to disable the ssh password through "ssh-keygen" and "authorized_keys" . i tried by echoing password from terminal as well as from script. But still it is prompting for the password.

Is it possbile ...?

Thanks
Krishnaprasad



--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux