5

I've been trying to store HTTPS GIT credentials using a Keyring (Gnome Keyring) using the steps in this article:

http://blog.iqandreas.com/git/storing-https-authentication-in-ubuntu-and-arch-linux/

I took these steps:

sudp apt-get install make
sudo apt-get install-gnome-keyring-dev
sudo make --directory=/usr/share/doc/git/contrib/credential/gnome-keyring
git config --global credential.helper /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring

Now when I use any remote git command, I get the error:

** (process:19273): CRITICAL **: Error communicating with gnome-keyring-daemon

Is it just not possible to run a daemon on WSL, or am I missing something simple? Sorry if this is a different type of question, I'm new on Ubuntu.

On another note, would it be a good idea to create a synonym 'WSL' for the tag 'ubuntu-on-windows'?

I think this might become the most logical acronym for ubuntu-on-windows: https://blogs.msdn.microsoft.com/wsl/

UPDATE:

I've tried what @LordMord said:

add at the end of ~/.bashrc

ssh-add -l &>/dev/null
if [ "$?" == 2 ]; then
  test -r ~/.gnome-keyring && \
    source ~/.gnome-keyring && \
    export DBUS_SESSION_BUS_ADDRESS GNOME_KEYRING_CONTROL SSH_AUTH_SOCK GPG_AGENT_INFO GNOME_KEYRING_PID

  ssh-add -l &>/dev/null
  if [ "$?" == 2 ]; then
    (umask 066; echo `dbus-launch --sh-syntax` > ~/.gnome-keyring; gnome-keyring-daemon >> ~/.gnome-keyring)
    source ~/.gnome-keyring && \
    export DBUS_SESSION_BUS_ADDRESS GNOME_KEYRING_CONTROL SSH_AUTH_SOCK GPG_AGENT_INFO GNOME_KEYRING_PID
  fi
fi

And it told me to install 2 more dependencies:

sudo apt-get install dbus-x11
sudo apt-get install gnome-keyring

but now I get this error on startup:

** (gnome-keyring-daemon:23): WARNING **: couldn't create socket directory: No such file or directory

** (gnome-keyring-daemon:23): WARNING **: couldn't bind to control socket: /home/wtijsma/.cache/keyring-3mToEe/control: No such file or directory

And this error when I try to use a remote GIT command:

Gkr-Message: couldn't connect to dbus session bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
  • I ended up just following his security conscious recommendation of using a long credential timeout so at least I only need to type it once a day. – carlin.scott Jan 26 '17 at 1:50
  • You might have an advice here? askubuntu.com/questions/905658/… – JohnDoea Apr 17 '17 at 5:32
1

add at the end of ~/.bashrc

ssh-add -l &>/dev/null
if [ "$?" == 2 ]; then
  test -r ~/.gnome-keyring && \
    source ~/.gnome-keyring && \
    export DBUS_SESSION_BUS_ADDRESS GNOME_KEYRING_CONTROL SSH_AUTH_SOCK GPG_AGENT_INFO GNOME_KEYRING_PID

  ssh-add -l &>/dev/null
  if [ "$?" == 2 ]; then
    (umask 066; echo `dbus-launch --sh-syntax` > ~/.gnome-keyring; gnome-keyring-daemon >> ~/.gnome-keyring)
    source ~/.gnome-keyring && \
    export DBUS_SESSION_BUS_ADDRESS GNOME_KEYRING_CONTROL SSH_AUTH_SOCK GPG_AGENT_INFO GNOME_KEYRING_PID
  fi
fi

Credentials are automatically added to ssh-agent provided that both the public and private keys are inside ~/.ssh. Keychain storing applications such as mysql-workbench(requires Xming) also work.

You can ignore this warning on bash startup

gnome-keyring-daemon: insufficient process capabilities, unsecure memory might get used

source: https://www.reddit.com/r/bashonubuntuonwindows/comments/4yhch4/using_gnomekeyringdaemon_for_ssh_keys/

  • 1
    thanks but unfortunately it didn't work for me, see update :( – Wiebe Tijsma Sep 6 '16 at 14:18
0

You don't need the modifications in your .bashrc

Install keyrings.alt

sudo pip install keyrings.alt

  • Some more details about how to set this up would be appreciated. Does gnome-keyring use this or does this take the place of gnome-keyring? Do I need to do anything with git config to use it? – carlin.scott Nov 20 '17 at 18:04
  • This is wrong on so many levels: 1. sudo pip install to break your system python installation (keyrings.alt is packaged in Debian & Ubuntu, so installing the package python-keyrings.alt or python3-keyrings.alt is enough. 2. This will only help if the tool you are using is using the Python keyring package, otherwise this is no fix at all – TobiX Apr 3 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.