Solved

How do you backup linux user accounts and groups?

Posted on 2007-03-26
4
1,747 Views
Last Modified: 2007-12-19
What is the correct way to backup/restore linux user accounts and groups?

With a clean OS install can you just copy a backup of /etc over... I was told not good for user accounts so then how?


Thanks!
0
Comment
Question by:techwhore
  • 2
4 Comments
 
LVL 32

Accepted Solution

by:
Kamran Arshad earned 125 total points
Comment Utility
0
 

Author Comment

by:techwhore
Comment Utility
Actually that is the article I was reading. What I am unsure of however is how to deal with a tar backup of /etc that contains the accounts.... I don't think that this solution applies because it is talking going from one live system to another live system... I am guessing there is a difference?

Thanks!
0
 
LVL 1

Expert Comment

by:crovaxy
Comment Utility
If you have a tarball containing the /etc directory of the old server, just uncompreed it to somewhere (eg: /tmp/old_etc/) and parse follow the article you're reading. Use the path /tmp/old_etc/ instead of /etc when creating the .mig files, eg:

# awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=65534)' /tmp/old_etc/passwd > /root/move/passwd.mig

instead of:

# awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=65534)' /etc/passwd > /root/move/passwd.mig

After the .mig are created, follow the article as it is.
0
 
LVL 1

Assisted Solution

by:crovaxy
crovaxy earned 125 total points
Comment Utility
If you already have new user accounts created on the new system, pay attention to the UIDs used by the users you're migrating. They should NOT collapse with the ones existing in the new server. If you're unsure about this, edit the /etc/passwd and the /tmp/old_etc/passwd file and check if there's users using the same UID (not applicable for the system users (< 500)... they won't be migrated if you follow the article).
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now