0

I would like to automate the login to an AIX server. I dont have a way to set up ssh keys im on mac so i cant install ssh pass so my only option left would be expect.

#!/usr/bin/expect -f

set timeout 20
spawn ssh name@host.com
expect "*: "
send "veryStrongPassword\r";

Issue with that is that nothing happens and i am thinking its because there is a new line above

Unauthorized use of this system is prohibited.
's password:

So my questiobn shoud i just add another expect on top with this line ?

What if i have several lines above the password ?

Thanks.

0 Answers0