Tuesday, 13 August 2013

python on linux - use 'pwd' module to read passwd file of remote machine

python on linux - use 'pwd' module to read passwd file of remote machine

I am executing a python script on one server and needing to read the
contents of the passwd file from a remote machine. Does anyone know of a
way to do this? Normally I would do:
import pwd
pwlist = pwd.getpwall()
#perform operations
This only works for the current system of course, and I'm needing a way to
access another machine (like you would via ssh). Any help is appreciated.

No comments:

Post a Comment