 |
 |
 |
 |
| Security and Privacy Sadly, malware, spyware, hackers and privacy threats abound in today's world. Let's be paranoid and secure our penguins, and slam the doors on privacy exploits. |

3rd July 2012, 06:28 AM
|
|
Registered User
|
|
Join Date: Jun 2009
Location: Queensland
Posts: 131

|
|
|
How best to backup and restore users and groups?
I have just moved up to FC17, from 15, on my laptop that only I use. Enough cruft came across with the upgrade and enough problems are appearing, that I want to start again and do a clean install instead of an upgrade.
I use deja-dup as my backup tool and have good backups. However, deja-dup stores files with the user id and group id, not the respective names. That means that, when I restore from my backup after a fresh installation of FC17, I need to recreate the users and groups with the same ids that they currently own. I don't want to have the nightmare of trying to change old user and group ids with to their new equivalent on all the files that I restore.
The question is: what is the best way to ensure my existing user and group ids and passwords are restored after repaving the machine? Do I need to write them all down and recreate them by hand in the fresh installation? Is there an automatic way of doing this? What are the pitfalls? Am I trying the hard way to do something simple?
|

3rd July 2012, 12:18 PM
|
|
Official Gnome 3 Sales Rep. (and Adminstrator)
|
|
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 30
Posts: 1,707

|
|
|
Re: How best to backup and restore users and groups?
The user and group names corresponding to UIDs and GIDs, along with their (encrypted) passwords, home directories and a few other basic user settings are stored in in /etc/passwd, /etc/shadow, /etc/group and /etc/gshadow. You could backup and restore these files too, but unless you install exactly the same software in the same order (difficult when talking upgrade vs. fresh install), you'd better just copy and paste the lines for UIDs and GIDs over 999.
|

5th July 2012, 02:45 AM
|
|
Registered User
|
|
Join Date: Jun 2009
Location: Queensland
Posts: 131

|
|
|
Re: How best to backup and restore users and groups?
Thanks for that advice, Gareth. The only important user/group details I can think of are postgres and apache and I expect it will be safer to create them from scratch than to restore my existing /etc/passwd etc.
Is it fairly random as to which UID and GID postgres and apache will be assigned, or is it standard for postgres to have UID and GID both numbered 26 and apache to have UID and GID numbered 48? If the system will automatically assign the same UIDs and GIDs that I have now when it creates these users, I have nothing to worry about.
|

5th July 2012, 04:45 AM
|
|
Registered User
|
|
Join Date: Aug 2010
Location: Al Ain, UAE
Posts: 1,054

|
|
|
Re: How best to backup and restore users and groups?
Here is what I do on all my systems:
# tar -zcvf etc.tgz /etc
That way , if some obscure setting gets forgotten or messed up, I can go and troll through it.
|

5th July 2012, 01:19 PM
|
|
Official Gnome 3 Sales Rep. (and Adminstrator)
|
|
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 30
Posts: 1,707

|
|
|
Re: How best to backup and restore users and groups?
Quote:
Originally Posted by Doug Hutcheson
Is it fairly random as to which UID and GID postgres and apache will be assigned, or is it standard for postgres to have UID and GID both numbered 26 and apache to have UID and GID numbered 48? If the system will automatically assign the same UIDs and GIDs that I have now when it creates these users, I have nothing to worry about.
|
I don't know about specific packages, or how they're allocated, but all system/daemon users should be with UIDs and GIDs less than 1000 (or 500 on pre-F16 installs). Since the user database files are plain text, and the UID/GID entries are fairly obvious, just copy and restore the lines for >= 1000 for real users. If you are keeping data for daemons (e.g. Postgres or Apache), it's probably best to "chown -R ..." their directories manually after reinstalling, as I don't know if a fresh install will use the same IDs as an upgrade.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 07:48 (Wednesday, 22-05-2013)
|
|
 |
 |
 |
 |
|
|