Interaction with the shell
Tyson Tate
nilobject at mac.com
Fri Jan 31 18:13:44 EST 2003
I have a def like so:
------
import os
def main():
print "Host [localhost]:",
host = raw_input(" ")
if host == "":
host = "localhost"
print "Command [ls]:",
command = raw_input(" ")
if command == "":
command = "ls"
data = os.popen("ssh " + host + " " + command).read()
print "Got dat: '" + data + "'"
-----
I'd like to enter the password from within the code (i.e. so that the
user doesn't enter the password). How might I do this? The man pages on
ssh don't say that there are any parameters through which I can supply
the password.
TIA, as always!
--
Tyson Tate, Editor
Entropy Magazine
"Nourishment For The Starved."
http://www.entropymag.net
More information about the Python-list
mailing list