LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Create user add file with default password and force user to change it? (http://www.linuxquestions.org/questions/linux-newbie-8/create-user-add-file-with-default-password-and-force-user-to-change-it-786466/)

Morgandy 02-02-2010 10:53 AM

Create user add file with default password and force user to change it?
 
Hi all, I'm wondering if the following is possible, and what the script would be:

I want to add 50 new users, not on the server yet
I want to add them all to group Accounting - with 1 option, not user by user
I want to setup a default password for them all, and have it say something like 'You must now change password or no access will be permitted'
Any other options I also want to do once, not for each user?

Is this possible, and what exactly would it look like?

Thanks greatly...

nicedream 02-02-2010 01:52 PM

You could write a script that runs the adduser command for each user, then runs the passwd command to set the password and its expiration date.

tredegar 02-02-2010 03:48 PM

Is this homework?

Even if it is, nicedream has given you the pointer to the solution.

Meanwhile you need to read man adduser man useradd and man passwd
If you still experience trouble, once you have made a reasonable effort at writing your script, if you post it here, with an explanation of the problems you are experiencing, I am sure someone will be able to help further.

chrism01 02-02-2010 05:06 PM

Use this tool http://linux.die.net/man/8/newusers


All times are GMT -5. The time now is 08:24 PM.