Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This 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!


  Search this Thread
Old 02-02-2010, 11:53 AM   #1
LQ Newbie
Registered: Dec 2009
Location: Cleveland
Posts: 16

Rep: Reputation: 0
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...
Old 02-02-2010, 02:52 PM   #2
Registered: Feb 2010
Distribution: Arch Linux
Posts: 68

Rep: Reputation: 19
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.
Old 02-02-2010, 04:48 PM   #3
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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.
Old 02-02-2010, 06:06 PM   #4
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,337

Rep: Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745
Use this tool


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to force user to change password after expiration in Linux? ssy68 Linux - Newbie 4 06-30-2011 03:54 PM
How to force a user to change their NIS password at logon? synthol6 AIX 1 08-17-2010 09:47 PM
user home dir doesn't create when new user add dev_mohamed Linux - Software 3 01-12-2007 02:08 AM
Help! Cannot Add a User to User Manager or Change Root Password lennysokol Linux - General 2 06-25-2005 10:59 AM
Samba: how to create a logon script file when i add a system user. heero82 Linux - Software 2 06-19-2003 09:29 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:34 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration