I am using this code for executing command on remote server.
ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],
result = ssh.stdout.readlines()
if result == :
error = ssh.stderr.readlines()
print >>sys.stderr, "ERROR: %s" % error
When I try to execute this script, I get prompt for password. Is there any way I could avoid it, for example, can I enter password in script somehow? Also, password should be encrypted somehow so that people who have access to the script cannot see it.