I am trying to run some commands to an AWS EC2 instance remotely via ssh within the python boto ssh module (which uses paramiko package). I am using boto.manage.cmdshell.sshclient_from_instance.run which works fine but the problem is that with .run is that it cannot do sudo command remotely. I get this error message:
sudo: sorry, you must have a tty to run sudo
I know I can manually login and edit permission to fix that but I want that part to be automated as well. I can launch an interactive shell using .shell but is there a way to automate commands within that interactive shell using python?