Errors Paramiko

AttributeError: 'NoneType' object has no attribute 'time'

AttributeError: 'NoneType' object has no attribute 'time'

Solved by adding the code

import time

To the beginning of the script and

time.sleep(1)

Right after calling the command

sudo: no tty present and no askpass program specified

sudo: no tty present and no askpass program specified

To get rid of this error, you can edit the file /etc/sudoers following this instruction

If that did not help, check whether the requiretty option is disabled

If you do not want to allow the user to run sudo without a password, the password can be entered interactively

(stdin, stdout, stderr) = client.exec_command(command=command,get_pty=True) stdin.write("your_password")

Article author: Andrei Olegovich

Banner image