#!/usr/bin/expect -f set timeout 3 spawn ssh root@192.168.1.1 expect "password: $" send "1234\r" interact