5

I install the following packages (not all can be install on both platform) :

  • Python 3.5.4 :: Anaconda custom (64-bit)
  • keyring 9.3.1
  • keyring_jeepney 0.2
  • keyrings.alt 1.2
  • SecretStorage 2.3.1

on both a Windows 7 machine:

Window 7

and on on a RHEL7 Linux machine:

$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.3 (Maipo)

$ cat /proc/version
Linux version 3.10.0-514.26.2.el7.x86_64 (sandman@node3res7) (gcc version 4.8.5 20150623 (SuSE 4.8.5-11) (GCC) ) #1 SMP Tue Jul 4 13:45:36 UTC 2017

On Windows the login and password are store in a secure older as expected and without any additional password. I think the WinVaultKeyring is only unlock when the correct user log in if I undertood everything correctly :

>>> from keyring import get_keyring

>>> get_keyring()

<keyring.backends.Windows.WinVaultKeyring object at 0x000000000361CAC8>

On Linux, it is a litttle bit different, a extra password is asked when you start to store loging and password. Evrry time I need to access a loging+password then this last password is requested: Please enter password for encrypted keyring:

You can a see the system storage keyring.backends is different:

>>> from keyring import get_keyring

>>> get_keyring()

<EncryptedKeyring at /home/Cxxxx/.local/share/python_keyring/crypted_pass.cfg>

So my question is which backend for keyring should I use on Linux RHEL7 to avoid this issue of extra password to access the login and password stored with keyring ? Which the actual backend it doesn't seems to be possible to disable it (I tried to put the same password as the linux one or empty password as suggested on forums but none of this work. I don't have admin right to install based packages but I can install python packages without any issue. I look at the doc https://pypi.python.org/pypi/keyring but didn't find the info I was looking at. The reason is that I need to run some code with a cron job and I need to access the few passwords: proxy, api and database.

Dr. Fabien Tarrade
  • 1,556
  • 6
  • 23
  • 49

1 Answers1

0

This is actually what just helped me connect the dots: https://pypi.org/project/keyring/#linux

The very first code example they had I used verbatim on my RHEL environment with success:

>>> import keyring
>>> keyring.set_password("system", "username", "password")
>>> keyring.get_password("system", "username")

Looks like a command line utility is also sent along with:

$ keyring --help
$ keyring set system username
$ keyring get system username

Hope this helps if you hadn't gotten along any further.

Douglas Korinke
  • 389
  • 7
  • 20
  • 2
    Unfortunately it doesn't tell which backend is used here. It could very well be a PlainText backend, which is not wanted here based on what OP installed (jeepney, secretstorage, etc.) – pawamoy May 27 '20 at 12:44