LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-18-2015, 04:56 AM   #1
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Rep: Reputation: 52
How to recreate users and their directories?


I reinstall Debian on a regular basis but each time I have to recreate all the users and their directories, is there a way I can do this automatically (excluding the contents of those directories)?

Thank you for your help.
 
Old 04-18-2015, 06:51 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,627

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
Recreate uses and directories

Google for user migration. You may benefit by reading the long version. In short:
Include at least one account of your own for testing.

filter /etc/group for the users and groups that apply.
filter /etc/shadow for the users
filter /etc/passwd for the users
back all of those up.
examine /home (or wherever you home your users) and back up those folders. Optionally, only the folder tree without the files. I recommend backing up the setting files (things like .bash_profile, etc) if those settings matter.
If they matter, back up your mail files for these users. (Generally /var/spool/mail/<username>, depending upon your mail system.

Build your new server

Restore the groups, passwd lines, homes, (optionally the mail), and shadow lines in that order.

Test.
 
1 members found this post helpful.
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] home users directories is gone BlinkingSpirit Slackware 2 09-30-2012 08:48 PM
recreate volatile files and directories Intel_ Fedora 5 12-04-2011 02:36 AM
How do you allow users access to Directories? kcpaige89 Fedora 5 02-20-2006 07:18 AM
new directories for new users kvtournh Mandriva 1 09-07-2005 10:07 AM
Enter other users' directories MasterC Linux - General 14 11-27-2002 12:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration