PAM_SNAPPER(8)

πŸ’– PAM_SNAPPER(8) πŸ’–

Filesystem Snapshot Management β€” bestie edition ✨

okay so real talk, pam_snapper is the manual page for a PAM module, and it's lowkey one of the cutest little utilities out there. it's giving "your filesystem but it remembers where you were before you broke everything" energy. let's get into it 🫢


✨ NAME ✨

pam_snapper β€” a PAM module which creates filesystem snapshots via "snapper" 🌸


πŸŽ€ SYNOPSIS πŸŽ€

pam_snapper.so [debug] [homeprefix=prefix] [ignoreservices=services]
               [ignoreusers=users] [rootasroot] [ignoreroot] [openonly]
               [closeonly] [cleanup=algorithm]

πŸ¦‹ DESCRIPTION πŸ¦‹

Create a snapshot at every login of a user, thus they always have a save starting point. πŸ’Ύβœ¨

ngl that's literally the whole vibe. every time you log in, boom, snapshot. you always have a restore point and you didn't even have to think about it. main character energy fr.

As many users do not logout for some time, it is a good idea to enable snapper's time based snapshots in addition. ⏰


πŸ’… OPTIONS πŸ’…

  • debug β€” Switch on debugging in the module. πŸ” turn this on when you wanna see what's actually happening in there, iykyk.
  • homeprefix=prefix β€” Prefix for the name of the snapper configuration. The username will be appended to this prefix. so like, prefix + username = the config name, periodt. Default: "home_"
  • ignoreservices=comma separated list of services β€” services that get skipped, comma separated bestie. Default: "crond"
  • ignoreusers=comma separated list of users β€” users that get skipped, also comma separated. Default: (none)
  • rootasroot β€” Perform a snapshot using the snapper configuration "root" if the user "root" logs in. In other words: the homeprefix is not used in this case. As the snapper configuration "root" is used for the system (the root filesystem), this means that with every login of the user "root" the complete "/" filesystem will be snapshotted. This can be useful to help administrators rolling back in case their activity / configuration changes have been accidentally wrong. 😭 this one is kind of a big deal β€” the WHOLE / filesystem, every single root login. iconic but also πŸ’€
"rootasroot" and "ignoreroot" are mutually exclusive. pick one, you cannot have both.
  • ignoreroot β€” No snapshot is taken, if the user "root" opens/closes a session. πŸ™ˆ root gets left alone entirely.
"rootasroot" and "ignoreroot" are mutually exclusive. again β€” one or the other, no both.
  • openonly β€” Only create a single snapshot when opening the PAM session. one and done on the way in. πŸšͺ✨ Default: create pre- and post-snapshots
  • closeonly β€” Only create a single snapshot when closing the PAM session. one and done on the way out. πŸšͺπŸ’¨ Default: create pre- and post-snapshots
  • cleanup=cleanup-algorithm β€” Set snapper cleanup algorithm. 🧹 Default: (none)

πŸ‘‘ MODULE TYPES PROVIDED πŸ‘‘

Only the module type "session" is provided. that's it. that's the whole list. one (1) module type. slay. πŸ’…


🌈 RETURN VALUES 🌈

  • PAM_SUCCESS β€” pam_snapper will always return PAM_SUCCESS, to not prevent users from login, in case a snapshot fails. This may change in the future.

so yeah, it never blocks you out, even if the snapshot flops. very forgiving of it honestly. 🫢 (but heads up, that behaviour may change in the future β€” noted.)


πŸ“ EXAMPLES πŸ“

Basic usage

  1. Create a btrfs subvolume for the new user and a snapper configuration, e.g. using the tool /usr/lib/pam_snapper/pam_snapper_useradd.sh. πŸ› οΈ
  2. Add the following line to /etc/pam.d/common-session:
session    optional    pam_snapper.so

and that's literally it bestie. boom. snapshots. ✨


πŸ”₯ SEE ALSO πŸ”₯

snapper(8), pam.conf(5), pam(8), pam_snapper_homeconvert, pam_snapper_pamconfig, pam_snapper_useradd, pam_snapper_userdel


🧚 HOMEPAGE 🧚

http://snapper.io/


πŸ’œ AUTHORS πŸ’œ

pam-snapper was written by Matthias G. Eckermann <mge@suse.com> as part of SUSE Hackweek#9 in April 2013. ✍️

This module would not have been possible without the work of Arvin Schnell on the snapper project. pam-snapper inherits DBUS handling from "snapper_dbus_cli.c" by David Disseldorp. 🌟

The module builds on the Linux PAM stack and its documentation, written by Thorsten Kukuk. πŸ™Œ


⭐ LICENSE ⭐

Copyright (c) 2013 SUSE

All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, contact SUSE.

To contact SUSE about this file by physical or electronic mail, you may find current contact information at www.suse.com. πŸ’Œ


and that's a wrap!! this page is version 0.13.0, dated 2013-05-23, brought to you by the fine folks behind PAM_SNAPPER(8) in Filesystem Snapshot Management. go forth and snapshot responsibly bestie πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from