Guest User

Untitled

a guest
Aug 22nd, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import paramiko
  2. import console
  3.  
  4. # Адрес, логин и имя исполняемой команды
  5. # strComputer = 'адрес'
  6. strComputer = input('Host: ')
  7. # strUser = 'логин'
  8. strUser = input('Login: ')
  9. # strPwd = 'пароль'
  10. strPwd = input('Pass: ')
  11. # strCommand = 'имя_команды'
  12.  
  13. # Подключаемся к серверу
  14. client = paramiko.SSHClient()
  15. client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  16. client.connect(hostname=strComputer, username=strUser, password=strPwd)
  17.  
  18. # Выполняем команду
  19. while True:
  20. stdin, stdout, stderr = client.exec_command(input(''))
  21. print(stdout.read())
  22.  
  23. client.close()
Add Comment
Please, Sign In to add comment