PAM_USERNET(8)
π
PAM_USERNET(8) β like, the pam_usernet situation
okay bestie, so this is a System Manager's Manual page for pam_usernet, and I am genuinely obsessed with what it does. let's get into it π«Ά
β¨ NAME β¨
pam_usernet β join the user own network namespace at login
(no cap, that's the whole vibe: you log in, you get your own little network world π)
π SYNOPSIS π
pam_usernet.so
that's it. that's the whole synopsis. she's lowkey mysterious like that π
π¦ DESCRIPTION π¦
The pam_usernet PAM module allow each user in usernet group to have their own network namespace. β¨
So here's the tea: if a network namespace having the same name as the username exists, pam runs the user shell in that namespace. If such a namespace does does not exist, it is created during the login process.
The system administrator can create a network namespace for each user in usernet group. Each namespace must be named after each username. Users will get their own network namespace at login. periodt. π
When pam_usernet is used together with a specific cado(1) configuration users can configure their own networking services. (see https://github.com/rd235/cado) β iykyk πΈ
π OPTIONS π
group=groupnameβ the module operates on users in the group groupname instead ofusernet. so like, you could change the group, but the default isusernetand honestly she's fine as she is πβοΈlodownβ leave the localhostlointerface in the stateDOWN. literally just... leaving it down. bestie is not coming back up π«rootsharedβ Leave the root filesystem/as shared so mounts can propagate out to the parent namespace.
β οΈ Warning: this feature can create security vulnerabilities if not properly used. no like, for real, be careful with this one. this is giving "main character energy but in a scary way" π
π RETURN VALUES π
PAM_IGNOREβ User does not belong to theusernetgroup. (not you bestie, no worries π«Ά)PAM_ABORTβ Error in retrieving the user id or in the namespace creation/joining. πPAM_SUCCESSβ Success. slay. β¨π
π EXAMPLES π
Add the following line to /etc/pam.d/sshd or /etc/pam.d/login
session required pam_usernet.so
literally just drop that line in and you're done. iconic. π§
π SEE ALSO π
π AUTHOR π
pam_usernet was written by Renzo Davoli and Eduard Caizer, University of Bologna. absolute legends, we stan π
okay that's the whole page, and to close it out with the receipts: this came from VirtualSquare Labs, dated August 17, 2016, and yeah it's the PAM_USERNET(8) page. bye bestie, go get yourself a network namespace πβ¨π¦
π¦ where this page comes from
- debian trixie: libpam-net 0.4-1 Β· GPL-2.0-or-later
- ubuntu questing: libpam-net 0.4-1
- ubuntu resolute: libpam-net 0.4-1build1 Β· GPL-2.0-or-later
- ubuntu stonking: libpam-net 0.4-1build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms