I am facing issues writing a script in Mobaxterm to automate my logins. The expect script doesn't seem to work quite well.
#!/usr/bin/expect -f
spawn telnet <IP address>
expect -re "login"
send "username\n"
expect -re "Password"
send "password of the user\n"
interact
Scenario: The infrastructure of my company requires me to ssh into a jump server and only then can i telnet into cisco routers. So my log in would look like this if I had to do it through CLI:
ssh x.x.x.x
telnet y.y.y.y
*******Company banner********
NOC : username
Password : password
Kindly help !
Probably the Answer is late and you might have found the solution but posting my solution just in case it helps someone in future :
For the Already Created Session which you want to Automate :