Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to read password from stdin #69

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

megabert
Copy link

@megabert megabert commented Apr 4, 2018

I'd like to have the possibility to have the password read from stdin to reduce the danger for the password to be easily captured when having root access to a XenServer.

At the moment the password is visible in the process list when directly supplied at the command line or nearly cleartext in the specified file base64-encoded.

That added change adds a third possibility: Specify "-" as the password in which case the password is read from stdin like this:

VmBackup.py - ".*" <<<'secret_password'

or

echo "$password" | ssh xenserver VmBackup.py - "vm-name-to-backup"

In this way the password is not shown in the process list and it does not have to be present on all XenServers. It can be kept on a secure remote machine, which initiates the start of the script.

NOTE:
I'm not really familiar with python very well, so look at my code with care.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant