Last active
August 9, 2016 22:12
-
-
Save gengwg/d4838000c8446ec95b1b591d72638d01 to your computer and use it in GitHub Desktop.
Connect to Cisco ASA
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
```python | |
#!/usr/bin/env python | |
from netmiko import ConnectHandler | |
from getpass import getpass | |
ip_address = raw_input("Enter IP address: ") | |
username = raw_input("Enter username: ") | |
device = { | |
'device_type': 'cisco_asa', | |
'ip': ip_address, | |
'username': username, | |
'password': getpass('Enter SSH password: '), | |
'secret': getpass('Enter enable password: '), | |
'port': 22, | |
} | |
net_connect = ConnectHandler(**device) | |
output = net_connect.send_command_expect('show version') | |
print output | |
``` | |
Ref: | |
https://github.com/ktbyers/netmiko/blob/master/netmiko/base_connection.py | |
https://github.com/ktbyers/netmiko/issues/157 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment