:: krowemoh

Sunday | 20 APR 2025
Posts Links Other About Now

previous
next

Automate Logging in Via Telnet

2024-07-17

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.