Creating new users in linux without using addmod or user add
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Creating new users in linux without using addmod or user add
Hi, I'm pretty new to linux and trying to figure out some things to help a friend that is taking a class.
What we're trying to do is write bash script to create a user, but can't use adduser or useradd or any other standard commands for adding a user in a single step. We've have been looking around but just haven't been able to find a way to do this.
Another thing that we're trying to do is write a script to create 100 users with names user001 through user100. When doing this we can use adduser or useradd or any other available programs which create a user in a single step, also make up the passwords, but they can all be the same. A way we can do this is create a script which creates a script to create the users. We are also having some trouble trying to do this.
The last thing that we are trying to do is write a script to create 100 users in the form of F######L where F is the first initial, ###### are the last 6 digits of an id or something like that, and L is the last initial. All of this stuff can just be random. The data will come from a file of the form lastname,firstname,IDnumber,password. We can use any of the available programs which create a user in a single step. We have to use the passwords given in the file for the users. We can also create a script which creates a script to create the users. We've been trying to do this but having problems.
Those are all of the things that we are trying to do. If anyone could help at all that would be greatly appreciated.
this reads an awful lot like homework... what you're doing appears to be totally arbitrary and largely pointless, suggesting it's just a learning exercise. Assuming that I am right, then you need to learn this for yourself using course materials and other resources provided for you. if you have specific questions once you're going, we'll be happy to help.
The thing that we are really stuck on is trying to create a user in a bash script without using the adduser or useradd command. We can't find anywhere how to do it without using adduser or useradd. If anyone knows a good reference where we could find how to do this or knows how to do this that would be really helpful.
I have one more question, I have pretty much everything figured out that I am trying to do except on the last part i'm trying to figure out how to write a bash script that will read from a text file named users.txt in the format of lastname,firstname,IDnumber,password and create users from that. The file i have setup is like this: Last,First,123456,abc123 and I am trying to have it output like this (# adduser F123456L). If anyone could help me out with this that would be really helpful.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.