Using Pexpect and netrc to automate commands which prompt for a password

Category: Python - Miscellaneous

System administrators sometimes need to automate commands which prompt for a password (or any other single prompt) before they execute. This recipe demonstrates using Pexpect and the built-in netrc module to automate these commands easily and relatively securely. Date: 13 February, 2012


Sysadmin

Homepage: http://code.activestate.com/recipes/572207-using-pexpect-and-netrc-to-automate-commands-which/?in=lang-python

Developer: John Landahl

License: Python License

Operating System: Windows

Add a Comment

all are required fields

     
What do you think of this resource?

Select Your Rate:

Votes:0

 

Related Scripts Download

Internet Billing Wizard 1.

developer Developer: http://tekmanproductions...
license License: Freeware
operating systems Operating System: Unix


Calculates IOPS for all disks in Linux/Unix system.

developer Developer: Slava Yanson
license License: Freeware
operating systems Operating System: Windows


RSH sometimes hangs if it cannot resolve to a given host.

developer Developer: Shrinidhi Rao
license License: Freeware
operating systems Operating System: Windows


Takes a stream of numbers and outputs simple ASCII graphs of those numbers.

developer Developer: Drew Gulino
license License: Freeware
operating systems Operating System: Windows


A Python script that runs arbitrary Python scripts in an input loop.

developer Developer: Drew Gulino
license License: Freeware
operating systems Operating System: Windows


LoggingWebMonitor listens for log records sent from other processes running in the same box or network.

developer Developer: Gabriel Genellina
license License: Freeware
operating systems Operating System: Windows


If you have a long running process that can be killed for strange and unknown reason, you might want it to be restarted.

developer Developer: Benjamin Sergeant
license License: Freeware
operating systems Operating System: Windows


Most people know how to write a page with HTML and CSS.

developer Developer: Dirk Holtwick
license License: Python License
operating systems Operating System: Windows


A simple way to implement Windows Service.

developer Developer: Louis RIVIERE
license License: Freeware
operating systems Operating System: Windows