LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


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

Rep: Reputation: Disabled
Smile Two password for same username


Hi
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
Noway2
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
wpeckham
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,085

Rep: Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893
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
ryran
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.
Code:
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.
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:57 PM.

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