Closed dashohoxha closed 6 years ago
I have created a basic script that reads username and password from user-accounts.txt
. And creates the users.
I can add import, export backup functionality by using case
. However I am not sure what should happen what should happen in each case.
So can you please elaborate a little bit.
What you have done is import
. The reverse process is export
(from the existing user accounts you create a text file that can be imported later, or to another server).
Backup is like export, but also saves a copy of the home directory of all the users. Restore is the reverse process (from a backup archive, recreate the user accounts and their home dirs).
The task is open. Think about it. What needs to be done to manage easily about 200 user accounts? It is not possible to manage them manually one by one. If you have tried ltsp-manager, maybe you have noticed that it has some features for bulk user management (for example using CSV files, etc.) Maybe you can get some ideas from it.
The reverse process is export (from the existing user accounts you create a text file that can be imported later, or to another server).
I can get the username from /etc/passwd
. But I am not sure how will I get the password as it is encrypted.
I am not sure either. Maybe you should keep it as encrypted.
Create a script called
accounts.sh
which can help to manage user accounts in bulk (big quantities). For example it can be used like this:The file
user-accounts.txt
can be a CSV file, or something like this: https://github.com/docker-scripts/shellinabox/blob/master/accounts.txt