Automatically unlock gnome keyring at boot

Hey!

I’m using i3 with EndeavorOS (really like the rice by the way) and i halso use visual-studio-code-bin rather than code because i want settings sync and github copilot. Therefore, i had to install gnome-keyring.
I don’t have a password on boot, it goes straight to the OS (this is my home-pc). I want gnome-keyring to be automatically unlocked on boot as well as it bothers me that i have to enter my password once i start vscode. I followed https://wiki.archlinux.org/title/GNOME/Keyring#PAM_method but the keyring is still not enabled on boot.

[buckfae@buckfae-pc ~]$ sudo cat /etc/pam.d/login 
#%PAM-1.0

auth       required     pam_securetty.so
auth       requisite    pam_nologin.so
auth       include      system-local-login
auth       optional     pam_gnome_keyring.so
account    include      system-local-login
session    include      system-local-login
session    optional     pam_gnome_keyring.so auto_start
password   include      system-local-login
[buckfae@buckfae-pc ~]$ cat ~/.bash_profile 
#
# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc

# Unlock gnome keyring
if [ -n "$DESKTOP_SESSION" ];then
    eval $(gnome-keyring-daemon --start)
    export SSH_AUTH_SOCK
fi
[buckfae@buckfae-pc ~]$ 

Thank you in advance!

When using console-based login, edit /etc/pam.d/login

But you will use lightdm and autologin as you describe?
so:
2022-02-17_11-11
would be the file to edit??

Not sure eat the moment about if this is working passwordless …

And welcome at the forum with such a nice little challenging question :milky_way: :enos_flag:

Welcome to the forum @Buckfae :partying_face::tada:

1 Like

I changed the file /etc/pam.d/lightdm:

[buckfae@buckfae-pc ~]$ sudo cat /etc/pam.d/lightdm
#%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

I assume that i had to remove the -?
It still does not work.

I can confirm that i’m using lightdm:

[buckfae@buckfae-pc ~]$ grep '/usr/s\?bin' /etc/systemd/system/display-manager.service
ExecStart=/usr/bin/lightdm

Script origin: https://unix.stackexchange.com/a/259224

You can also try installing seahorse and set the password for the keyring as blank.

i would bet the issue comes with autologin as it does not unlock your key in this case.

I decided to just remove autologin. Now (after i logged in properly) the keyring is unlocked. Thank you anyway!

1 Like

that’s the issue with this … and seem still the only workaround is to use an empty password for unlocking the key… not really the best option… and having login screen is not that bad :wink:

Yea i guess so. Thank you a lot for your help!

Do you mind sharing your .bashrc or your terminal config in general? Looks really awesome!

this is zsh and I am a simple guy …, I use “oh-my-zsh”
ZSH_THEME="obraun"
some helping tools installed in addition and sourced:

zsh-autosuggestions
find-the-command
zsh-syntax-highlighting
fortune (and mods you like :wink: )

alias cat=‘bat’ is what makes the cat output showing with line-numbers

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.