Remote SSH

By.

min read

My profile

Share this:

When you have no option left use expect

#!/usr/bin/expect -f
set timeout -1

set myvar [lindex $argv 0];

spawn ssh theuser@$myvar "whoami"
#match_max 1000000
expect "*assword:*" { send "password_here\r" }
expect eof
Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *