LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 02-02-2010, 10:53 AM   #1
Morgandy
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, 01:52 PM   #2
nicedream
Member
 
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, 03:48 PM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,012

Rep: Reputation: 367Reputation: 367Reputation: 367Reputation: 367
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, 05:06 PM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

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


Reply


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 02:54 PM
How to force a user to change their NIS password at logon? synthol6 AIX 1 08-17-2010 08:47 PM
user home dir doesn't create when new user add dev_mohamed Linux - Software 3 01-12-2007 01:08 AM
Help! Cannot Add a User to User Manager or Change Root Password lennysokol Linux - General 2 06-25-2005 09:59 AM
Samba: how to create a logon script file when i add a system user. heero82 Linux - Software 2 06-19-2003 08:29 PM


All times are GMT -5. The time now is 05:20 AM.

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