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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I was wondering if there were a special way of adding users with the -p option (passwd option).
I am writing a script that needs to add 100 users at the end of a kickstart installation and cannot input the password for each directly.
I have tried useradd -p <clear text passwd here> <user acct here>.
But when I try to login the password is incorrect. I am sure that I have missed something in the man page for useradd. And I know it probably has something to do with "crypt". But I cannot figure out what.
Yes, you must specified the encrypted password, not the plaintext password. Here's a handy Perl script to generate the useradd command for a list of usernames and passwords (one entry per line, usernames and password separated by a space). WARNING: this is not tested.
Thanks for the replies. I read all the links, and nothing from them worked out. I did not try the perl script above simply because I am not sure how that will work out with the rest of the script. (The rest of the script is BASH commands only, and as I stated before this is going to be a post-install script for a Kickstart install. I don't think I can change interpreters during the process...could be wrong though, I am new to KS Installs as well.). However, those articles and that perl script above did get my head moving again. This is what I came up with.
1. On the local NFS server (the one where my script is held anyways). I created a local user account with the password I wanted for the above mentioned 100 users. (no worries about security here, the Install server only gets hooked to the network when it is needed. It also only gets hooked up to rooms that it need to via a VLAN. Otherwise it is locked in the server closet, powered down and disconnected).
2. Then a simple:
/usr/sbin/useradd -p `cat /etc/shadow | grep <my server username here> | cut -d: -f2` <workstation account name here>
Again thanks for all the help. This really got my brain going again.