I want to write script on python which could execute shell commands on a remote server.
I find out that I could use something like:
# set environment, start new shell
p = Popen("/path/to/env.sh", stdin=PIPE)
# pass commands to the opened shell
p.communicate("python something.py\nexit")
But I do not understand how can I login to remote Linux server and execute shell commands there?