Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 01-24-2012, 07:43 AM   #1
LQ Newbie
Registered: Jan 2012
Posts: 1

Rep: Reputation: Disabled
Smile Two password for same username

How's that possible for one username with two different password help me regarding this
thanks in advance
Old 01-24-2012, 11:01 AM   #2
Senior Member
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
It shouldn't be. Passwords are typically mapped to the user name in the file /etc/shadow where they are hashed.

Please provide clarification and details on what you are trying to resolve.
Old 01-24-2012, 01:23 PM   #3
Senior Member
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDo, tinycore, Q4OS,Manjaro
Posts: 4,618

Rep: Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271
Not easily

I have seen two stage authentication using passwords at both stages by use of a PAM module and a MySQL database (to hold the passwords for one layer). I would not attempt to tell you HOW to achieve that, it is non-trivial. Perhaps if you Google for PAM tricks and authentication you will find a tutorial.
Old 01-25-2012, 08:20 AM   #4
LQ Newbie
Registered: Dec 2011
Location: Abu Dhabi
Distribution: Fedora
Posts: 19

Rep: Reputation: Disabled
wpeckham interpreted your question as being about two-stage authentication.
I interpret it as you wanted to allow two different people to logon as the same user, and that is completely possible. I'm going to assume you're dealing with local user authentication.

Usernames are simply names mapped to UIDs. It's trivial to map two usernames to the sme UID.
You'll need to create a new user, either with useradd or by editing the four files /etc/passwd, /etc/shadow, /etc/group, /etc/gshadow. To demonstrate, I'll assume you want to have two logins for a user named arash. The new login that will also give access to the arash account will be bob.
useradd -u $(id -u arash) -g $(id -g arash) -h $(awk -F: '/arash/{print$6}' /etc/passwd) -M -o bob
passwd bob
So there ya go. You have two different usernames with different passwords, but when either logs in, they will see their username as arash and will have full access to arash's files.


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
username and password a7mlinux Linux - Security 14 08-11-2009 11:27 AM
What username and password to use for . . . royeo Linux - Newbie 1 09-28-2006 12:37 AM
username and password no go bmd Linux - Newbie 7 04-06-2005 09:26 PM
username/password sailu_mvn Programming 5 12-21-2004 04:21 AM
UserName and Password luis8460 Red Hat 0 07-08-2004 05:45 AM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:41 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration