#!/usr/bin/expect -f
set user [lindex $argv 0]
set host [lindex $argv 1]
set password [lindex $argv 2]
set port [lindex $argv 3]
set timeout -1
spawn ssh -o StrictHostKeyChecking=no -p$port $user@$host
expect "*assword:*"
send "$password\r"
interact
expect eof 


