j is a simple expect script to securely automate the network login of IOS-like networking equipment by leveraging the open-source password manager pass.
Dependencies:
Functionality:
- Automatically insert username, password, and enable password during device login
- Password and enable password are stored securely in the pass
.password-store
- Add agrument
--telnet
to specify a telnet destination
Todo:
- Improve error handling
- Add linux sshd destination support
- Add alternative password manager support
Arch:
sudo pacman -S expect
sudo pacman -S pass
Debian and Ubuntu:
sudo apt install expect
sudo apt install pass
CentOS:
sudo yum install expect
sudo yum install pass
Open j
in a text editor and add your username and pass descriptors:
set username <your_username>
set password [exec pass show <your_pass_descriptor>]
set enable [exec pass show <your_pass_descriptor>]
chmod +x j
Also, it's best if you moved j
to a directory part of PATH.
SSH:
j 192.168.100.52
Telnet:
j --telnet 192.168.100.42