PAM Support - Open for Discussion
Requested in 2 places:
-
https://github.com/RsyncProject/rsync/issues/682
-
https://github.com/RsyncProject/rsync/discussions/949
Adding support for PAM seems like the easiest way to get 2FA (and perhaps other desirables) going with rsyncd. Other 2FA alternatives for rsync I'm aware of also encrypt the data payload(yuck) rather than simply the credentials. I may dare take a stab at it myself if it's something rsync maintainers would willingly accept..
I am not completely opposed to the idea. Will leave this open for opinions.
@steadytao I don't know a lot about PAM, I'd trust your judgement on this
@steadytao I don't know a lot about PAM, I'd trust your judgement on this
Will think on what shape may fit rsync best and get back to this.
I have thought about the shape of this a bit more and I do not think PAM can be treated as a simple drop-in replacement for the current rsyncd secrets-file check. The current daemon auth protocol is a challenge-response where the client sends user digest(password + challenge), not the clear password. Ordinary PAM authentication expects the application to provide authentication tokens through a PAM conversation so full PAM password/2FA auth would imply either a new protocol path or sending clear authentication material over the daemon connection. That is not something I would want to make casual or implicit, especially since raw rsync daemon traffic is not encrypted.
The shape I think could fit rsync first is narrower:
- keep
auth usersandsecrets fileas the authentication mechanism - add optional PAM account validation after successful rsyncd authentication
- make it build-time optional and off by default
- use a configurable PAM service name, probably defaulting to
rsyncd - call
pam_acct_mgmt()rather thanpam_authenticate() - document clearly that this is account/policy gating, not 2FA
That would let admins apply PAM account policy such as disabled/expired accounts or host/access restrictions without changing the daemon protocol or exposing clear passwords. Full PAM authentication/2FA is a larger design question. I would keep that separate because it needs protocol, transport, prompt/conversation and compatibility decisions before it even becomes possibly safe to implement.