mirror of
https://github.com/autistic-symposium/web3-starter-py.git
synced 2025-05-18 06:30:23 -04:00
rename
This commit is contained in:
parent
dac26e1abb
commit
90049c80af
15 changed files with 0 additions and 0 deletions
17
Security_examples/python_ssh_modules/server_example.py
Normal file
17
Security_examples/python_ssh_modules/server_example.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
HOST_KEY = paramiko.RSAKey(filename='test_rsa.key')
|
||||
USERNAME = 'buffy'
|
||||
PASSWORD = 'killvampires'
|
||||
|
||||
class Server(paramiko.ServerInterface):
|
||||
def __init__(self):
|
||||
self.event = threading.Event()
|
||||
|
||||
def check_channel_request(self, kind, chanid):
|
||||
if kind == 'session':
|
||||
return paramiko.OPEN_SUCCEEDED
|
||||
return paramiko.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED
|
||||
|
||||
def check_auth_password(self, username, password):
|
||||
if (username == USERNAME) and (password == PASSWORD):
|
||||
return paramiko.AUTH_SUCCESSFUL
|
||||
return paramiko.AUTH_FAILED
|
Loading…
Add table
Add a link
Reference in a new issue