c0d3dsk1lls

create_ssh_connection.py

Jun 27th, 2022 (edited)
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. #CREATE SSH CONNECTION.
  2. import string
  3.  
  4. def main():
  5.    
  6.     port = '22'
  7.     ip = '192.168.0.30' # unbuntu.
  8.     username = 'username'
  9.     password = 'password'
  10.     timeout = 5
  11.     client_policy = paramiko.AutoAddPolicy()
  12.     client = paramiko.SSHClient();
  13.     client.set_missing_host_key_policy(client_policy)
  14.     client.connect(ip, username=username, password=password)
  15.     print(client)
  16.    
  17. if __name__ == '__main__':
  18.     main()
  19.  
Add Comment
Please, Sign In to add comment