LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 01-31-2013, 08:55 PM   #1
vivchowd
LQ Newbie
 
Registered: Jan 2013
Posts: 3

Rep: Reputation: Disabled
Bash for multiple accounts with auto-gen passwords


I need a script to create bulk users in unix. I need some assistance from you for creating 100 or more User IDs using a bash script:

Here's my requirements:

1. I need to create 100 or even more user ids of different naming conventions. So, I would like to have a separate file(Example: usernames.txt) where I can paste the user ids, Name for Each ID, Group Name or GID, Serial Number) and call that file in the script

2. The script should contain the block of code that will auto-generate random 8-character long alphanumeric and mixed-case passwords without special characters or symbols(Something like < /dev/urandom tr -dc A-Za-z0-9_ | head -c8 ) for each ID and these system-generated passwords should be saved in a different file after the script is run. (Example: passwords.txt)

I googled but couldn't find a solid script for my above requirements.
 
Old 02-01-2013, 01:27 AM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,251

Rep: Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026
Well, this cmd may well be part of the soln http://linux.die.net/man/8/newusers, but for the rest, what have you done (code) so far?
 
Old 02-01-2013, 04:20 AM   #3
vivchowd
LQ Newbie
 
Registered: Jan 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Chris, I am not a pro at scripting. I am just trying several scenarios myself and even learning these from the scripts available online. So, if you can provide the script with some explanation, I'd appreciate it a lot.
 
Old 02-01-2013, 04:25 AM   #4
vivchowd
LQ Newbie
 
Registered: Jan 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Chris, I have found this link useful but the only disadvantage in this code is that we have to manually specify the passwords for bulk id creations in a file which wont even serve the motive of scripting. The script should auto generate passwords and provide the list of passwords(one per line) in a separate file for our later use.
 
  


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
accounts and passwords in centos sigint-ninja Linux - Newbie 4 07-16-2012 06:12 PM
Linux Bash - Is it even possible to login into multiple email accounts? gqchynaboy Programming 2 02-03-2010 02:11 PM
Fedora 12 - Help! gtkpod does not auto-launch when ipod 5.5 gen is attached Ehtetur Fedora 0 12-07-2009 08:47 PM
Fetchmail with multiple mail accounts and local accounts lmcilwain Linux - Software 3 04-01-2007 02:58 PM
Passwords for accounts ToothlessRebel Slackware 4 07-05-2005 01:03 PM


All times are GMT -5. The time now is 05:23 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