Thursday | 31 OCT 2024
[ previous ]
[ next ]

Automate Logging in Via Telnet

Title:
Date: 2024-07-17
Tags:  

I wrote a little script to log me into D3 machines over telnet:

#!/usr/bin/expect -f

spawn telnet 192.168.1.15

expect "Enter your user id:"
send "username\r"

expect "master dictionary:"
send "accountName"

interact

This uses the expect package that can be installed with yum or apt depending on distro.

The last statement interact is what let's you take the session over as otherwise the script will exit.