cruegge / pam-gnupg

Unlock GnuPG keys on login
GNU General Public License v3.0
269 stars 12 forks source link

Can pam-gnupg work with multiple login sessions? #43

Closed amano-kenji closed 2 years ago

amano-kenji commented 2 years ago

There are 7 TTYs on linux.

cruegge commented 2 years ago

GPG uses only a single agent shared between all login sessions, so multiple sessions should work without issues.

amano-kenji commented 2 years ago

But, if one of loggined sessions logs out, what happens to the other sessions?

Does pam-gnupg count the number of login sessions for a specific user? systemd pam module counts the number of a user's login sessions.

Or, logging out doesn't lock gnupg?

cruegge commented 2 years ago

pam-gnupg is really quite simple, it only send the input password to the agent. The rest depends on how the agent is started and how it's lifecycle is managed. pam-gnupg can optionally start the agent, but what happens after that depends on the system configuration. Maybe it's launched into the systemd user session and gets killed when the session terminates, but maybe not. Also, I think it's generally better to start the agent first as a systemd user service instead, and then the lifetime depends on that service's configuration. pam-gnupg simply does not handle these details at all.

amano-kenji commented 2 years ago

I don't use systemd.

cruegge commented 2 years ago

Well, then it depends on whatever service manager or session setup you're using.