I need to add 10 users by a script in Ubuntu 12.04.
That could reduces time by adding users manually , and i can apply this script on other desktop .
Each user will has a specific user and in specific group.
Any idea?
I need to add 10 users by a script in Ubuntu 12.04.
That could reduces time by adding users manually , and i can apply this script on other desktop .
Each user will has a specific user and in specific group.
Any idea?
Open a terminal and type:
vim /tmp/name
to create a file and the names of the users: eg:Create User with Home Dir and default shell:
Create password for each user:
Try newusers
echo "vivek:myUltraSecretPassword" | sudo newusers
You could try this, I suppose.
Look at the answer here,which says unless you have a whole lot of users to add the best way is to use
adduser
(for adding users) andusermod
(for adding a user to a group) which takes care of a lot of things. If you still wish for some pre-made script, there is one here and another one here, but I do not know if they really work for youIt is my solution. I created file
/tmp/userlist
and added all users name, after completion of script it will create users and you can find user name and given random password in file/tmp/userlist-created
. I know it is not perfect solution.