LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-09-2011, 02:19 AM   #1
niharikaananth
Member
 
Registered: Aug 2011
Posts: 58

Rep: Reputation: Disabled
multiple uid for user


Hi....can anybody please tell me, Is it possible to having multiple userID for a user. If yes, could you please tell me how can a user have multiple uid instead of one.
 
Old 08-09-2011, 02:30 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
No. There is a one-to-one mapping between username and uid. The username is just used in /etc/passwd and /etc/shadow and the name of the directory in /home. The UID is what the system uses instead of the username. The username is a convenience.

You can use groups and acls to allow multiple users to access files & directories.

There is also su and sudo which allows a user to assume the identify of another, knowing that users password.
 
1 members found this post helpful.
Old 08-09-2011, 02:49 AM   #3
rupinder07
LQ Newbie
 
Registered: Aug 2011
Posts: 8

Rep: Reputation: Disabled
HI
it is not possible to have multiple user ids for same user , but u can usee same userid for multiple users.
man of useradd command can help u with that.
 
1 members found this post helpful.
Old 08-09-2011, 03:47 AM   #4
niharikaananth
Member
 
Registered: Aug 2011
Posts: 58

Original Poster
Rep: Reputation: Disabled
multiple uid for user

Could you please give any url link which shows "one-to-one mapping between username and uid"

Quote:
Originally Posted by jschiwal View Post
No. There is a one-to-one mapping between username and uid. The username is just used in /etc/passwd and /etc/shadow and the name of the directory in /home. The UID is what the system uses instead of the username. The username is a convenience.

You can use groups and acls to allow multiple users to access files & directories.

There is also su and sudo which allows a user to assume the identify of another, knowing that users password.
 
Old 08-09-2011, 03:58 AM   #5
niharikaananth
Member
 
Registered: Aug 2011
Posts: 58

Original Poster
Rep: Reputation: Disabled
multiple uid for user

If two users(user1 & user2) is using same userID, Then can user1 delete the files & folders, which belongs to user2, if yes it should not happen so. Because I migrated one old server to new server, again I have to migrate anotherone old server to the same new server. So I found already those uid, again which server's users has to be added in new server are already using. So could please tell me, is there any possible way to do this? or any useful url links.
I will be waiting for ur kind reply

Quote:
Originally Posted by rupinder07 View Post
HI
it is not possible to have multiple user ids for same user , but u can usee same userid for multiple users.
man of useradd command can help u with that.
 
Old 08-09-2011, 04:08 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Quote:
Originally Posted by niharikaananth View Post
Could you please give any url link which shows "one-to-one mapping between username and uid"
The mapping is in the /etc/passwd file. The system calls don't look at the username. The kernel uses the UID of the process and checks the permissions to determine whether you have access.

The username is also listed in the /etc/shadow file. The shadow file maps the username to the hash of the users password. The passwd file is world readable, so the hash was moved to the shadow file to prevent password cracking.

You can use the command "getent passwd <username>" or "getent passwd <#UID>" or the `id' command to get your user id. You can also read the passwd file yourself.

The passwd file even has its own man page: `man 5 passwd'.

Last edited by jschiwal; 08-09-2011 at 04:11 AM.
 
1 members found this post helpful.
  


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
Unprivileged user uid gabsik Linux - Security 3 02-19-2009 09:25 AM
read uid of a last user dhanabalanb Programming 1 07-28-2007 04:32 AM
Multiple users with the same UID Korto SUSE / openSUSE 2 07-15-2006 10:19 AM
How can I change a user's uid and gid? homesp Debian 2 05-31-2005 03:39 PM
Changing User IDs (UID) totalcommand Linux - Newbie 5 06-06-2003 07:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:29 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration