Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import paramiko
- from getpass import getpass
- import time
- ip = raw_input("Please enter device IP address: ")
- username = raw_input("Please enter your username: ")
- password = getpass()
- remote_conn_pre=paramiko.SSHClient()
- remote_conn_pre.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- remote_conn_pre.connect(ip, port=22, username=username,password=password,look_for_keys=False, allow_agent=False)
- remote_conn = remote_conn_pre.invoke_shell()
- output = remote_conn.recv(65535)
- print output
- # select the issue from below:
- #1)Remote Access VPN
- #1.2) is it a cert issue-do you know the public ip of user
- #2)Site to Site VPN issue- please enter the public ip for vendor with issue
- remote_conn.send('enablen')
- remote_conn.send(password + 'n')
- remote_conn.send("terminal length 0n")
- time.sleep(5)
- output = remote_conn.recv(65535)
- print output
- remote_conn.send("show aaa-servern")
- time.sleep(5)
- output = remote_conn.recv(65535)
- print output
- remote_conn.send("exitn")
- time.sleep(5)
- output = remote_conn.recv(65535)
- print output
- remote_conn.transport.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement