Create password based on...


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Create password based on...
# 1  
Old 05-24-2012
Create password based on...

I have to create a bunch of functional (non-user) accounts that are owned by 1 person. And I create several of these functional accounts each day so there are several owners. Is there a way to make a password based off an algorithm that uses the owners identification number, so all accounts I create that day will have the same password for the corresponding owner. The algorithm could change based on date but for that 1 day the owner of accounts would receive the same password for what they requested.

Right now I used a formula in xcel:
Code:
=CHAR(MID(N2,3,2)/100*(57-48)+48)&CHAR(N2,blah blah blah)&CHAR(MONTH(NOW())/10*blah blah blah)

Where N2 is the cell of the owner's identification number. Any suggestions?
# 2  
Old 05-25-2012
What you want is a hash. Since I cannot make heads or tails of your Excel example
consider using the userid + todays date. There are lots of hashing programs, you probably have md5sum

Code:
$ echo "`date +%Y%m%d` johnuser" | md5sum | cut -c25-32

This value will be the same all day long. You can adjust the output length, you can get another hashing program. You choose - this is a starting point.
# 3  
Old 05-25-2012
Nice - I just tested it now and it's consistent. I'll google more examples and this is extremely helpful. Thanks!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Create combinations based on scores

Hi experts, I have a score matrix like below, where the 3rd column ( 1 max, 0 min) says how close the 2nd column variable is to the 1st column variable a b 0.3 a c 0.87 a d 0.75 b x 0.67 b y 0.98 b z 0.24 c ... (4 Replies)
Discussion started by: jianp83
4 Replies

2. Shell Programming and Scripting

Need one line command to create and set password for new user...

Using useradd abc --password password (5 Replies)
Discussion started by: Jagruti Rml
5 Replies

3. Shell Programming and Scripting

solaris create password in a script and continue

:eek:Below is my code to create a user account but it doesn't take a password automatically. I have to run the password command seperately to do this What I want to do is to be able to accept the password in a script. In linux with the "useradd' command you can give the "-p" flag to accept the... (3 Replies)
Discussion started by: slufoot80
3 Replies

4. Shell Programming and Scripting

solaris create password in a script and continue

:eek:Below is my code to create a user account but it doesn't take a password automatically. I have to run the password command seperately to do this What I want to do is to be able to accept the password in a script. In linux with the "useradd' command you can give the "-p" flag to accept the... (1 Reply)
Discussion started by: slufoot80
1 Replies

5. Shell Programming and Scripting

solaris create password in a script and continue

Below is my code to create a user account but it doesn't take a password automatically. I have to run the password command seperately to do this What I want to do is to be able to accept the password in a script. In linux with the "useradd' command you can give the "-p" flag to accept the... (1 Reply)
Discussion started by: slufoot80
1 Replies

6. Solaris

Create New Group/User/Password in S10

I have performed the following with lower case group and usernames and the only difference is that the error message under groupadd goes away, yet I am still unable to successfully add a user WITH a home directory. This is in Solaris 10. I am able to add a group, add a user, add the users... (3 Replies)
Discussion started by: Showflash
3 Replies

7. Shell Programming and Scripting

Create script for change root password via SSH

HI I 'm new shall script and unix. I want to create script for change password root by ssh-keygen command . I have 50 servers and I want ot login ot the servers via ssh by type ones password and can login every machines.The script ssh-keygen must ot generate key every weekly than it send new... (2 Replies)
Discussion started by: pellnapook
2 Replies

8. Shell Programming and Scripting

Create new user account and password in shell script

I am trying to create a shell script that will: check if a specific user already exists if not, create a specific group and create the user in that group assign a password to that user, where the password is passed in as a parameter to the script The problem that I need help with is 3 on... (4 Replies)
Discussion started by: killuane
4 Replies

9. Shell Programming and Scripting

automatically create password and expand it to other servers

I´m a new system administrator. I have to create a script to put in crontab to change periodically root password and didtribute it to other servers. I searched the posted threads but I didn't find my answer. I would like to do this using ssh and trusted keys. Can anyone help me? Thanks. Aldina (0 Replies)
Discussion started by: Alrica
0 Replies

10. UNIX for Dummies Questions & Answers

create password file

Hi all, I am trying to send a file from my local machine to some remote machine using sftp functionality...I have already checked this thread. here it says: sftp -b /dev/fd/0 remotehost <<EOF But I dont understand how to make a password file on this location (/dev/fd/0) ?? And what... (2 Replies)
Discussion started by: cutiepie2004
2 Replies
Login or Register to Ask a Question