You are not logged in.

#1 2016-09-10 13:48:11

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

[Solved] Lightdm + Thunar + i3wm - no automatic keychain unlock

So this has been an ongoing issue for me through most tiling window managers (AwesomeWM, XMonad, i3).  The keychain gets unlocked properly when using gdm + gnome, but I'd prefer to work with lightdm.  Admittedly, I haven't tried gdm with i3.

The Problem
Logging into i3 through lightdm results in a prompt for my password when opening Thunar for the first time after log in.  This is with thunar being run as a daemon through i3 autostart.

Things Checked

The pam.d file exists for lightdm, and contains all the entries as listed in the ArchWiki article.

#%PAM-1.0
auth        include     system-login
auth        optional    pam_gnome_keyring.so
account     include     system-login
password    include     system-login
session     include     system-login
session     optional    pam_gnome_keyring.so	auto_start

The password for the keychain is also my user's login password.

After logging in through Thunar the first time it opens, the password isn't asked for again, and USB automounting works as expected.

The Question
I've looked around, and tried as many of the options I could find, but so far, haven't managed to fix the issue.  Is there something I should try, some file I should look for/edit, or should I just give up and switch to GDM (provided that works with i3 and thunar)?

I'm happy to post any more information as may be required - I've just posted what I have seen as being relevant.

Last edited by lswest (2017-02-09 08:43:30)


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

#2 2016-11-16 16:43:56

jmontano
Member
From: Colombia
Registered: 2013-04-29
Posts: 9

Re: [Solved] Lightdm + Thunar + i3wm - no automatic keychain unlock

I had  a similar problem with my gnome-keyring not loading when using LightDM + Deepin desktop, this worked for me and may shed some light on your issue:

1. I opened google keychain manager and removed the password from my keyring (I guess this step might be optional)
2. I added

 export $(gnome-keyring-daemon -s)

to

 ~/.xprofile

  following the instructions from Nurdletech » Linux Notes

Offline

#3 2016-11-16 18:37:15

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

Re: [Solved] Lightdm + Thunar + i3wm - no automatic keychain unlock

Thanks, I'll give that a shot.  I'll update this post with results tomorrow.

*EDIT* No dice.  Thunar still instantly asks for the password, and Seahorse indicates a locked padlock before I enter the password in Thunar.  Removing the password entirely isn't something I want to do.

Last edited by lswest (2016-11-17 08:16:37)


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

#4 2017-02-08 20:59:28

Szunti
Member
Registered: 2011-06-24
Posts: 2

Re: [Solved] Lightdm + Thunar + i3wm - no automatic keychain unlock

I had this problem too. I looked after it and found that starting gnome-keyring-daemon is a two step process.

  1. gnome-keyring-daemon --login # this basicly just reads the password and stores it for the later initialization

  2. gnome-keyring-daemon --start # this is what really starts the daemon, and this is where unlocking happens

The reason for this is that pam_gnome_keyring can get the password, but can't be sure that everything is available already that it needs. D-bus for example might not be running. So pam_gnome_keyring does the first step, then the daemon for some reason waits only 120 seconds for the start which is coming usually via d-bus activation, but you can run it yourself. After 120 seconds, the original daemon, which knows the password quits. And if you run thunar now it will start a new daemon, but it doesn't know the password and can't unlock the keyring.

So the solution is to run

/usr/bin/gnome-keyring-daemon --start --foreground --components=secrets #you can omit --foreground, if you want it to quit

manually or just use the daemon and let dbus activation run the command for you before the 120 seconds elapse.

Offline

#5 2017-02-09 08:47:07

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

Re: [Solved] Lightdm + Thunar + i3wm - no automatic keychain unlock

I've just marked this thread as solved. After Szunti posted yesterday, I decided to double-check everything. In doing so, I saw that the Wiki page stated that lightdm should work out of the box with gnome-keyring.  After comparing the pam files from the package with those on my system, I saw that the hyphens were missing in the copy on my computer. After putting them back in, the keyring seems to unlock fine (at least, I have access to SSH Agent). I still get the same pop-up as usual with Thunar, but it appears to be udisks2 asking for a password to mount /dev/loop2, and is therefore probably unrelated (as the SSH Agent works without entering my password in Thunar, which it didn't before).

*EDIT* Seahorse also confirms that the keyring is unlocked, and the Thunar prompt is therefore unrelated. I also did not add Szunti's advice to my .i3/config. I do, however, have eval $(gnome-keyring-daemon -s) in my .bash_profile.

Last edited by lswest (2017-02-09 08:50:11)


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

Board footer

Powered by FluxBB