Linux - SoftwareThis 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.
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.
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)?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.