Visit Our UNIX and Linux User Community

Bash for multiple accounts with auto-gen passwords

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Bash for multiple accounts with auto-gen passwords
# 1  
Old 01-31-2013
RedHat Bash for multiple accounts with auto-gen passwords


I am studying few things on unux and scripting. I need a script to create bulk users in unux. 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:

I googled but couldn't find a solid script for my above requirements.
# 2  
Old 01-31-2013
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.

Previous Thread | Next Thread
Test Your Knowledge in Computers #606
Difficulty: Easy
MySQL 7.0 added the JSON utility function JSON_PRETTY(), which outputs an existing JSON value in an easy-to-read format.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash Loop for password gen

Hey guys, I'm trying to make a bash script to do password generation. The script takes 2 arguments, number of characters and number of passes to generate, but I can't get the loop to work properly. #!/bin/bash echo echo echo -ne "Password length:" read pwd_length echo echo -ne "Number of... (6 Replies)
Discussion started by: 3therk1ll
6 Replies

2. Shell Programming and Scripting

How to change passwords for User accounts on multiple UNIX/Linux machines remotely?

Hello Experts, Need some direction on creating shell script for following environment: We have about 20 people in the team working as Oracle DBA's (sysdba's and appdba's). Total Servers which is a mix of Unix and Linux are 200. We do not have Root user access on any of the servers and... (3 Replies)
Discussion started by: sha2402
3 Replies

3. UNIX for Advanced & Expert Users

Store passwords , accounts, IPs, hostnames

Hi, this question is not specially unix related, but I expect advanced and expert unix users to have a solution for this, and I've found no other subforum that fits ;) what do you use to store accounts, customer ids, ip addresses, users and specially passwords, to access them from... (6 Replies)
Discussion started by: funksen
6 Replies

4. Linux

awk filter & Auto gen Mail

hi experts 2012-01-30 10:30:01:812 "y" "NA" "30/01/2012 10:30:01:154 AM" 2012-01-30 10:33:46:342 "y" "NA" "30/01/2012 10:33:45:752 AM" 2012-01-30 10:41:11:148 "n" "200" "30/01/2012 10:41:10:558 AM" 2012-01-30 10:44:48:049 "y" "NA" ... (7 Replies)
Discussion started by: nith_anandan
7 Replies

5. OS X (Apple)

Multiple hosts SSH NO PASSWORD - each time it overrides the last key gen

Hello, here is my problem: I have 20 machines that need to SSH into 1 machine throughout the day. The issue is every time I go through the process of putting my keys from one of the computers that needs to SSH to the server that needs to accept all the incoming SSH's it overrides the last one. ... (6 Replies)
Discussion started by: yoyoyo777
6 Replies

6. UNIX for Dummies Questions & Answers

single user mode - user accounts passwords

hello ppl, someone must be able to help with this --> I have an old NCR tower 32 with an ADDS terminal running a unix version 020102 (Im not sure if thats correct but its unix for sure). I have no user names and no passwords and need to login to read a tape. Is there any way to do that? I hear... (3 Replies)
Discussion started by: orestis
3 Replies

7. Shell Programming and Scripting

Gen. Question - Script calls multiple programs - Return Code Handling?

General Question: If a script calls multiple external programs (external to the script, but still on unix), where do the return codes go? Let's say one of external programs fails, does the entire script fail and send a non-zero return code to the job scheduling software, or is the return code sent... (1 Reply)
Discussion started by: jnanasakti
1 Replies

8. Shell Programming and Scripting

How to pass passwords to bash scripts?

I'm finding the following command very tedious to type in all the time, so I created a one line bash script called mount.bash with the following contents: mount -t cifs //mark/C\$ -o unc=//mark\\C$,ip=,user=Administrator,password=$1 /mnt/mark I don't like the fact that I have to put... (5 Replies)
Discussion started by: siegfried
5 Replies

9. Solaris

Auto Locking user accounts

Hi, I am trying to setup account locking in Solaris 9. I have made the changes in /etc/default/login where RETRIES=5 and SYSLOG_FAILED_LOGINS=5 and in /etc/user_attr I am having: test_user::::lock_after_retries=yes Still I am not able to lock test_user after successive unsuccessful... (1 Reply)
Discussion started by: run_time_error
1 Replies

10. UNIX for Dummies Questions & Answers

Expiration dates of accounts' passwords ?

Hi How do I view/set the expiration dates of the accounts passwords in my FreeBSD ? Thanks in advance (1 Reply)
Discussion started by: sbayeta
1 Replies

Featured Tech Videos