Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import paramiko
- import console
- # Адрес, логин и имя исполняемой команды
- # strComputer = 'адрес'
- strComputer = input('Host: ')
- # strUser = 'логин'
- strUser = input('Login: ')
- # strPwd = 'пароль'
- strPwd = input('Pass: ')
- # strCommand = 'имя_команды'
- # Подключаемся к серверу
- client = paramiko.SSHClient()
- client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- client.connect(hostname=strComputer, username=strUser, password=strPwd)
- # Выполняем команду
- while True:
- stdin, stdout, stderr = client.exec_command(input(''))
- print(stdout.read())
- client.close()
Add Comment
Please, Sign In to add comment