Is it possible to have an Expect script spawn an SSH session, log in, then go into interactive mode and give control of the SSH session to a Bash script? Here's a simplified example of the script so far:
Code:
#!/bin/bash
expect -c "
spawn -noecho ssh $user@$host
expect {
"*password:*" { send $password\r\n; interact }
eof { exit }
}
exit
"
ls -l | zenity --list --title "Select files" --column "Files" --separator=" " --multiple
As you might guess, I'm trying to create an interactive GUI for several routine SSH commands. Basically, I need to figure out how to pass commands from a local Bash script to a remote machine and make decisions based on feedback from the remote machine. Would it be easier to do this with port forwarding, and if so, can Expect be used to supply the password? RSA is not an option on these servers, unfortunately.