SSH login to serverA
From A login again on serverB
Use expect to do this, the first step is very good to write, write the second step, is stuck, I understand this time need to use spawn a new process, but how to do?
#!/bin/bash
The/usr/bin/expect & lt;
Set the timeout - 1
Expect "password:"
Send "root \ n
"Expect "#"
The send date "\ n"
Send "SSH root @ & lt; ServerB> \ n "=====& gt; There are problems
Expect "password:"
Send "root \ n
"Interact
Expect eof
EOF