Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Security and Privacy
FedoraForum Search

Forgot Password? Join Us!

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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 3rd July 2012, 06:28 AM
Doug Hutcheson Offline
Registered User
 
Join Date: Jun 2009
Location: Queensland
Posts: 131
linuxfirefox
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?
Reply With Quote
  #2  
Old 3rd July 2012, 12:18 PM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 30
Posts: 1,707
linuxfirefox
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.
Reply With Quote
  #3  
Old 5th July 2012, 02:45 AM
Doug Hutcheson Offline
Registered User
 
Join Date: Jun 2009
Location: Queensland
Posts: 131
linuxfirefox
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.
Reply With Quote
  #4  
Old 5th July 2012, 04:45 AM
flyingfsck Offline
Registered User
 
Join Date: Aug 2010
Location: Al Ain, UAE
Posts: 1,054
linuxfirefox
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.
Reply With Quote
  #5  
Old 5th July 2012, 01:19 PM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 30
Posts: 1,707
linuxfirefox
Re: How best to backup and restore users and groups?

Quote:
Originally Posted by Doug Hutcheson View Post
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.
Reply With Quote
Reply

Tags
backup, groups, restore, users

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A n00bs question on Backup and Restore - Time Machine / System Restore wise (!!) padre_e Gamers' Lounge 3 25th August 2010 02:18 PM
Users & Groups (missing users?) visualocity Security and Privacy 1 25th August 2009 12:52 PM
backup restore and restore point. F.User_4_Life Using Fedora 0 12th April 2008 12:51 AM
Users/groups addr Using Fedora 2 25th January 2007 03:24 PM


Current GMT-time: 07:48 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat