I\'m running this command to ssh into a server and open a textfile
sudo ssh -i ~/key.pem ubuntu@$ip -t "sudo nano /path/to/a/file.py"