j is a simple expect script to securely automate the network login of IOS-like and Junos-based 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 argument
--t
to specify a telnet host - Add argument
--j
to specify a junos host
Todo:
- Add ability to specify alternate port
- Improve error handling
- 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 --t 192.168.100.42