Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import paramiko
- nmsIp = "IP"
- user="user"
- pwd = "pwd"
- ssh = paramiko.SSHClient()
- ssh.load_system_host_keys()
- ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- ssh.connect(nmsIp, 22, username=user, password=pwd)
- channel = ssh.invoke_shell()
- stdin = channel.makefile('wb')
- stdout = channel.makefile('rb')
- stdin.write('''
- sqlplus
- select * from *');
- exit
- exit
- ''')
- print stdout.read()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement