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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-18-2015, 04:56 AM
|
#1
|
Senior Member
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,305
Rep:
|
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.
|
|
|
04-18-2015, 06:51 AM
|
#2
|
LQ Guru
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 6,195
|
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.
|
All times are GMT -5. The time now is 09:34 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|