Linux (ubuntu/bash) script to add users manually
Go to solution
Solved by Jade,
18 minutes ago, aurrorax said:I have found this aswel, unfortunately I am not allowed to use adduser or useradd , newusers is allowed.
Should be easy enough, then. Here's the manpage for newusers -- not gonna do all your work. ;)
This code is untested and I can't be held liable for it, all that legal stuffs.
How to run the script:
./myUserScript thisListOfImportedUsers
What's in the script, theoretically. $1 is variable 1 (argument -- thisListOfImportedUsers)
#!/bin/bash
newusers $1
What's in thisListOfImportedUsers - formatted as
<Username>:<Password>:<UID>:<GID>:<User Info>:<Home Dir>:<Default Shell>
tester1:tester1!:6001:6011:testaccount:/home/tester1:/bin/bash
tester2:tester2!:6002:6012:testaccount:/home/tester2:/bin/bash
tester3:tester3!:6003:6013:testaccount:/home/tester3:/bin/bash

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now