Fabric is a high level Python (2.7, 3.4+) library designed to execute shell commands remotely over SSH, yielding useful Python objects in return
pip install fabric
from fabric import Connection
host= "153.92.XX.XX"
port= 22
user= "root"
password= "password123"
con= Connection(host, port= port, user= user, connect_kwargs= {"password": password})
def exe(cmd):
out= con.run(cmd)
return out.stdout.strip()
while(True):
cmd= input("$ ")
out= exe(cmd)
with con.cd("/desired/location"):
out= exe("ls")