I am experimenting with (main)UNIX users and groups configuration on my system (how many, which names they have, passwords, etc.) in Linux. Would it be possible to create a simple backup of the relevant files for the sake of preserving the working state. E.g.:
# #Here everything is fine with users/groups config
# tar -cvf users_groups_passwords.tar /etc/passwd /etc/group /etc/shadow
# #Here I do something dangerous:
# groupadd ...
# useradd ...
# passwd ...
# #Here I decide I want to restore from backup
# tar -C / -xvf users_groups_passwords.tar
Would it work? I mean:
- am I actually missing some config file?
- is there some more complex magic happening when a user/group is created/modified in modern Linux systems (kernel v5+), besides the old style UNIX configs, that would prohibit this simple backup solution?