Last active
November 25, 2020 10:49
-
-
Save stefan-wolfsheimer/054217e053bd72a828b1a155f31cd3b7 to your computer and use it in GitHub Desktop.
irods password obfuscation with python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# ###################################################### | |
# irods password obfuscation on system without icommands | |
# | |
# Usage: | |
# 1. install irods python client with | |
# pip3 install python-irodsclient | |
# (see https://github.com/irods/python-irodsclient ) | |
# 2. execute script | |
# | |
import irods.password_obfuscation as password_obfuscation | |
from getpass import getpass | |
import os | |
irods_a_file = os.path.expanduser('~/.irods/.irodsA') | |
with open(irods_a_file, "w") as fp: | |
password = getpass() | |
pw = password_obfuscation.encode(password) | |
fp.write(pw) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment