Open mowgli opened 3 years ago
I'm unfortunately neither familiar with Gentoo nor xdm/wdm, and since I mostly use systemd for starting the agent, the autostarting feature is also slightly undertested.
store-only
option in auth
, then the helper terminated with exit code 1
error message is probably harmless, it only means that the agent could not be contacted during authentication..Xauthority
. What's the error message in strace
? Does your .Xauthority
have a non-standard location, i.e. is $XAUTHORITY
set?DISPLAY=localhost:10.0
, which does look suspicious, and might explain why the pinentry can't start, and also cause the Xauthority issue. On the mailing list you wrote that updatestartuptty
does not help. Maybe we should try to find out why. Do you use a non-default $GNUPGHOME
?./configure --with-moduledir=/lib64/security
.I try to answer your questions. I never use systemd on my systems. And this is one reason I use Devuan and Gentoo.
.Xauthority
and .gnupg
are standard. The DISPLAY to :10.0 is from ssh to the box but there is no difference to :0 when using it locally.Now the pam stuff. pam file wdm
auth substack system-local-login
account substack system-local-login
password substack system-local-login
session substack system-local-login
pam file system-local-login
auth include system-login
auth optional pam_gnupg.so
account include system-login
password include system-login
session include system-login
session optional pam_gnupg.so
pam file system-login
auth required pam_shells.so
auth required pam_nologin.so
auth include system-auth
account required pam_access.so
account required pam_nologin.so
account include system-auth
password include system-auth
session optional pam_loginuid.so
session required pam_env.so envfile=/etc/profile.env
session optional pam_lastlog.so silent
session include system-auth
session optional pam_motd.so motd=/etc/motd
session optional pam_mail.so
So it is equivalent than the config on Devuan where it work.
Some stuff I already posted on the mailing list:
pinentry(-qt) has no file capabilities, the process of gpg-agent has the
following:
~> getpcaps 27031
27031: cap_dac_override,cap_net_admin,cap_net_raw,cap_sys_rawio,cap_sys_admin=i
And in strace I find the following:
28441 20:23:54 capset({version=_LINUX_CAPABILITY_VERSION_3, pid=0}, {effective=1<<CAP_IPC_LOCK, permitted=1<<CAP_IPC_LOCK, inheritable=0}) = -1 EPERM (Die Operation ist nicht erlaubt)
28441 20:23:54 capset({version=_LINUX_CAPABILITY_VERSION_3, pid=0}, {effective=0, permitted=1<<CAP_IPC_LOCK, inheritable=0}) = -1 EPERM (Die Operation ist nicht erlaubt)
28443 20:23:54 capset({version=_LINUX_CAPABILITY_VERSION_3, pid=0}, {effective=1<<CAP_IPC_LOCK, permitted=1<<CAP_IPC_LOCK, inheritable=0}) = -1 EPERM (Die Operation ist nicht erlaubt)
28443 20:23:54 capset({version=_LINUX_CAPABILITY_VERSION_3, pid=0}, {effective=0, permitted=1<<CAP_IPC_LOCK, inheritable=0}) = -1 EPERM (Die Operation ist nicht erlaubt)
I get the same errors when I set the capabilities to cap_ipc_lock=ep.
I tried both, pinentry linked to libcap and without. No difference.
I am encountering the same problem on slackware64-current (also not using systemd). I can use the cached passphrase but once the max-cache-ttl
expires, attempting to decrypt using gpg2
will result in:
❯ gpg --decrypt ~/.password-store/google.com/dotcore.co.il.gpg
gpg: encrypted with 4096-bit RSA key, ID 7E7930E005478F3C, created 2020-06-13
"Julian Grinblat (Vae victis) <julian@dotcore.co.il>"
gpg: encrypted with 4096-bit RSA key, ID 75A99057A2B7F3DB, created 2020-05-21
"Julian Grinblat (Vae victis) <julian@dotcore.co.il>"
gpg: public key decryption failed: No pinentry
gpg: decryption failed: No secret key
Restarting gpg-agent
will restore the pinentry
:
❯ gpgconf --kill gpg-agent
❯ gpg --decrypt ~/.password-store/google.com/dotcore.co.il.gpg
gpg: encrypted with 4096-bit RSA key, ID 7E7930E005478F3C, created 2020-06-13
"Julian Grinblat (Vae victis) <julian@dotcore.co.il>"
gpg: encrypted with 4096-bit RSA key, ID 75A99057A2B7F3DB, created 2020-05-21
"Julian Grinblat (Vae victis) <julian@dotcore.co.il>"
{encrypted content}
I didn't have problems with the pinentry before installing pam-gnupg
.
Some of my setup:
❯ cat /etc/pam.d/login
#%PAM-1.0
auth required pam_securetty.so
# When using pam_faillock, print a message to the user if the account is
# locked. This lets the user know what is going on, but it also potentially
# gives additional information to attackers:
#auth requisite pam_faillock.so preauth
auth include system-auth
# To set a limit on failed authentications, the pam_faillock module
# can be enabled. See pam_faillock(8) for more information.
#auth [default=die] pam_faillock.so authfail
#auth sufficient pam_faillock.so authsucc
auth include postlogin
account required pam_nologin.so
account include system-auth
password include system-auth
session include system-auth
session include postlogin
session required pam_loginuid.so
-session optional pam_ck_connector.so nox11
-session optional pam_elogind.so
auth optional pam_gnupg.so store-only
session optional pam_gnupg.so
❯ cat ~/.gnupg/gpg-agent.conf
pinentry-program /usr/bin/pinentry-dmenu
allow-preset-passphrase
max-cache-ttl 86400
❯ cat ~/.zshrc | grep gpg
gpg-connect-agent updatestartuptty /bye >/dev/null
I will try to dig into this too
I use pam-gnupg on gentoo and devuan. While on devuan, everything is fine, on gentoo pinentry, when started by gpg-agent started via pam-gnupg, is not able to use X. Moreover, the fallback to tty is not working too.
The only issue I see in logs is:
What I already tried:
Here some Stuff that I posted on the mailinglist:
For the version, I just tried with the latest version from git. Still the same problem.
A minor additional error: pam_gnupg is installed in /lib/security while on gentoo it needs to be in /lib64/security; at least on 64 bit. Gentoo installs pam modules in both locations. I solved this issue with symlink.