Created
November 6, 2017 00:50
-
-
Save jtl999/bd3ca25aa64d48d0787c61521abe7a4f to your computer and use it in GitHub Desktop.
connect-1910
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect | |
set PASSWORD "changeme" # Change this | |
set HOST "switch-1910" # host in .ssh/config | |
spawn ssh $HOST | |
expect "password: " | |
send "$PASSWORD\r" | |
expect "Copyright (c) 2010-2017 Hewlett Packard Enterprise Development LP" # Could use a more generic detection for the prompt. | |
send "_cmdline-mode on\r" | |
expect "All commands can be displayed and executed." | |
send "Y\r" | |
expect "Please input password:" | |
send "512900\r" # At least on my unit (firmware: 1519P03) | |
expect "Warning:" | |
send "system-view\r" | |
interact # Drop into SSH session |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment