Quantcast
Channel: All ScreenOS Firewalls (NOT SRX) posts
Viewing all articles
Browse latest Browse all 2577

Python Paramiko with netscreen

$
0
0

Hello,

 

I am trying to use python script to connect to netscreen firewall using paramiko and grap some commands output. It works fine with Juniper SRX, however it is not working on netscreen. If any solution or alternative script can be used please let me know

 

import paramiko

List = ['10.1.1.1']

for router in List:
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.load_system_host_keys()
client.connect(router, username='netscreen',password='netscreen')
print '\n' + '\n' + "[-] SSH connection established successfully to %s" % router + '\n'
stdin, stdout, stderr = client.exec_command("get config")
data = stdout.read()
print data
client.close()

 

-------------------------------

 

OUTPUT

 

[-] SSH connection established successfully to 10.1.1.1

Traceback (most recent call last):
File "E:\ssh.py", line 12, in <module>
stdin, stdout, stderr = client.exec_command("get config")
File "C:\Python27\lib\site-packages\paramiko\client.py", line 418, in exec_com
mand
chan.exec_command(command)
File "C:\Python27\lib\site-packages\paramiko\channel.py", line 60, in _check
return func(self, *args, **kwds)
File "C:\Python27\lib\site-packages\paramiko\channel.py", line 234, in exec_co
mmand
self._wait_for_event()
File "C:\Python27\lib\site-packages\paramiko\channel.py", line 1103, in _wait_
for_event
raise e
paramiko.ssh_exception.SSHException: Channel closed.


Viewing all articles
Browse latest Browse all 2577

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>