Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Here is the question: I want user A to have the same password as user B. How to do that?

share|improve this question
1  
Which OS? Any special authentication packages? –  jscott Jun 12 '12 at 17:32
1  
What are you trying to achieve here? Different users should have different passwords because that allows you to distinguish between them. If more than one user knows the password of a certain user you might as well use a single account. –  Bram Jun 12 '12 at 18:24
    
It was an exam question dude. I know that it is not an honest real life situation. –  alfish Jun 17 '12 at 10:30

1 Answer 1

up vote 4 down vote accepted

Change the /etc/shadow file, copy the hash from user B over the hash of user A. That's it :)

share|improve this answer
    
Caveat: Every user with root access can now KNOW the fact the passwords are the same without needing to try. This may or may not be a problem; password salting was invented for exactly that reason :) –  rackandboneman Jun 12 '12 at 18:00
2  
Caveat 2: whenever user A or B changes the password the paswords will not be in sync unless this procedure is repeated. I doubt the OP is looking for something to set the passwords equal just once. You might as well enter the same password twice. –  Bram Jun 12 '12 at 18:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.