For those who want to answer that I should use SSH keys, please refrain
I am trying to use wait in a bash script to provide an SSH password. Providing a password works, but I don't get into the SSH session as it should, it goes back to bash.
My script:
#!/bin/bash read -s PWD /usr/bin/expect <<EOD spawn ssh -oStrictHostKeyChecking=no -oCheckHostIP=no usr@$myhost.example.com' expect "password" send "$PWD\n" EOD echo "you're out"
The output of my script is:
spawn ssh -oStrictHostKeyChecking=no -oCheckHostIP=no usr@$myhost.example.com usr@$myhost.example.com password: you're out
I would like to have an SSH session and only when I exit it to return to my bash script. The reason I use bash before waiting is because I have a menu where I can choose which device to connect to.
thank
linux bash ssh expect
Max Jan 24 '11 at 10:22 2011-01-24 10:22
source share