create a Random passwd


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting create a Random passwd
# 1  
Old 02-28-2003
Question create a Random passwd

Hello Everyone,
I am wondering how to create a Random Password of 8 characters for a user. It has to be run in a script.
Also, The user have to be asked to change his/her password the first time they login.

I tried using genPass but seems like my system doesn't support that command.

For your info , I am a sort of new user.........

A prompt reply will be appreciated alot!

Thanks,
Ben
# 2  
Old 02-28-2003
What OS are you using? It may help in giving a more 'correct' answer.

You can generate a password with any higher language...

A Perl script a co-worker wrote long ago has the following (grabs the name and adds random numbers to the end to create a password)
#!/u/bin/perl
...
... other code not shown...
...
# Pick a initial password.

$rvalue = int(rand(1000));
($uhead) = ( $name[0] =~ /^(.{1,4})/ );
$nv = join('',$uhead,$rvalue);
$pwd = crypt($nv,$SALT);
...
...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Create 'n' number random pairwise combination of words

File 1 contains the list of words that needed to be randomly paired: Tiger Cat Fish Frog Dog Mouse Elephant Monkey File 2 contains the pairs that should not be used (in any solution) during random pairing. Elephant-Dog Cat-Fish Monkey-Frog Dog-Elephant, Fish-Cat, Frog-Monkey... (1 Reply)
Discussion started by: sammy777888
1 Replies

2. Shell Programming and Scripting

awk to create variables to pass into a bash loop to create a download link

I have created one file that contains all the necessary info in it to create a download link. In each of the lines /results/analysis/output/Home/Auto_user_S5-00580-6-Medexome_67_032/plugin_out/FileExporter_out.67... (8 Replies)
Discussion started by: cmccabe
8 Replies

3. Shell Programming and Scripting

Need to generate a file with random data. /dev/[u]random doesn't exist.

Need to use dd to generate a large file from a sample file of random data. This is because I don't have /dev/urandom. I create a named pipe then: dd if=mynamed.fifo do=myfile.fifo bs=1024 count=1024 but when I cat a file to the fifo that's 1024 random bytes: cat randomfile.txt >... (7 Replies)
Discussion started by: Devyn
7 Replies

4. Shell Programming and Scripting

Create random number

Hi, I'm trying to create a script that will print random numbers with length of three. Below is the expected out. 928-377-899 942-458-310 951-948-511 962-681-415 995-161-708 997-997-209 thanks (4 Replies)
Discussion started by: reignangel2003
4 Replies

5. AIX

When did AIX start using /etc/security/passwd instead of /etc/passwd to store encrypted passwords?

Does anyone know when AIX started using /etc/security/passwd instead of /etc/passwd to store encrypted passwords? (1 Reply)
Discussion started by: Anne Neville
1 Replies

6. Shell Programming and Scripting

no chance to input passwd when create new user in loop

Hi Dears, I have one script to create new users with information in one plain text file. This script will read all lines in the file and create one users for one line. Sample file: #action;login,full name title,expire date,project +;gmwen,Bruce Wen QA,04/01/2012,BT +;xxdeng,Shown Deng... (4 Replies)
Discussion started by: crest.boy
4 Replies

7. Ubuntu

expect script for random password and random commands

Hi I am new to expect. Please if any one can help on my issue its really appreciable. here is my issue: I want expect script for random passwords and random commands generation. please can anyone help me? Many Thanks in advance (0 Replies)
Discussion started by: vanid
0 Replies

8. Solaris

passwd cmd reenables passwd aging in shadow entry

Hi Folks, I have Solaris 10, latest release. We have passwd aging set in /etc/defalut/passwd. I have an account that passwd should never expire. Acheived by emptying associated users shadow file entries for passwd aging. When I reset the users passwd using passwd command, it re enables... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies

9. Solaris

Solaris Boot Problems, random messages [/etc/rcS: /etc/dfs/sharetab: cannot create]

Hello All, I have all of a sudden developed issues with booting up one of my Solaris Servers. Upon a routine reboot, I was faced with the following errors: Feb 1 07:56:44 sco1-au-tci scsi: WARNING: /pci@1c,600000/scsi@2/sd@0,0 (sd0): Feb 1 07:56:44 sco1-au-tci Error for Command: read(10)... (9 Replies)
Discussion started by: ranjtech
9 Replies

10. Programming

how to create random no between 10 to 40 in C

can any one tell me how to create integer random no between 10 to 40 in C language.When i m using random() or rand() functions they r creting some long int which is not required (5 Replies)
Discussion started by: useless79
5 Replies
Login or Register to Ask a Question