LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 10-27-2011, 08:06 AM   #1
Nerdio
LQ Newbie
 
Registered: Sep 2011
Posts: 27

Rep: Reputation: Disabled
Question Change User ID once logged in


Is it possible to change a users ID once they have logged in. What I am thinking is this;

User logs in with one identity, and then once authenticated, has the identity of a different user.

I would be looking for a by user mapping, ie

user_1 ---> paul
user_2 ---> susan

This sounds like an odd request, but I am trying to avoid renaming a lot of user accounts across multiple servers.

Thanks in anticipation.
 
Old 10-27-2011, 11:56 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
no, that's not going to happen. maybe you would bebefit from sudo to allow one user to run things as another? If not maybe a much more detailed description of your scenario would help.. e.g. where are these users held? ldap? nis? why do their uid's matter?
 
Old 10-27-2011, 12:07 PM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
What do you mean by "identity"? The username or the uid? That is the first or the third field of /etc/passwd?
 
Old 10-28-2011, 02:11 AM   #4
Nerdio
LQ Newbie
 
Registered: Sep 2011
Posts: 27

Original Poster
Rep: Reputation: Disabled
The requirement is that I log in with one username (Domain Username), and this is then mapped to another username (Login Username) once authenticated.

The original user name, which is authenticated, is authenticated against AD on a Windows PDC using Samba.

Once logged in though there are various reqts for the username to change;

- The users already have home directories based on different usernames, it would be nice to use these as they are instead of having to create links, or renaming them.

- There are scripts that use the username to access other servers where the username needs to be the 'mapped to' name.

For example,
I log onto a Linux box with my domain username, and am authenticated with that. I then run scripts that access CVS on another box, but the script uses my Linux username. I am trying to avoid a widespread change of all user names across multiple servers, at least in the short term.

I have tried the username map facility in smb.conf, but this does not seem to work, as it always wants the home directory based on the Domain username. This solution does otherwise look to be pretty much what I want.

I hope that is a little clearer.
 
Old 11-08-2011, 07:33 AM   #5
Nerdio
LQ Newbie
 
Registered: Sep 2011
Posts: 27

Original Poster
Rep: Reputation: Disabled
This thread seems to have fallen quiet.

I believe the username map facility in Samba should be able to do what I want, but I cannot make this work. Can anyone suggest a way to 'debug' that functionality?

Does anybody have a checklist of things I would need to have done to get 'username map' to work?

Many thanks in anticipation
 
Old 11-08-2011, 09:43 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
If you question is about "the username map facility in Samba", you may get more answers if you start a new thread with that in the subject.
 
Old 11-11-2011, 02:47 AM   #7
Nerdio
LQ Newbie
 
Registered: Sep 2011
Posts: 27

Original Poster
Rep: Reputation: Disabled
I have created another thread here asking a more direct question, but the moderators closed it saying it was a duplicate.

I am really struggling with this, as I have had little positive feedback. Maybe I am asking the wrong questions, I don't know.

So maybe I should consider if username map is really what I want...

1) If I have username map bloggsf --> fredb, where bloggsf is the AD domain login name, and fredb is the linux box name, then should I expect once I have authenticated as bloggsf, that the home directory will be that for fredb?

2) If I subsequently type whoami, will it report back with fredb (the Linux user name), or bloggsf (the AD domain user name)?

Many thanks in anticipation.
 
Old 11-11-2011, 07:14 AM   #8
vickyk
Member
 
Registered: Dec 2009
Posts: 38

Rep: Reputation: 6
Sudo command was a good idea.


Also I am not sure but it may be possible to insert a line in the .bashrc of "bloggsf" user to sudo to "fredb" and get access to "fredb" home directory. The /etc/sudoers file needs to be modified.

Also, I guess all non-root users have equal privileges so configuring sudoers file won't be a big hassle.

GIYF.
 
Old 11-11-2011, 07:28 AM   #9
Nerdio
LQ Newbie
 
Registered: Sep 2011
Posts: 27

Original Poster
Rep: Reputation: Disabled
I would agree sudo is one solution, and may actually be THE solution.

I can't get away from the fact that the username map option in smb.conf does just what I want, or at least from what I have read. The problem is, I don't seem to get any answers as to how it works, or might work. That makes me feel that it is not the right thing to do.
 
  


Reply



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
[SOLVED] How to confirm an user logged in is a remote user? kirtikjr Linux - Server 4 08-05-2011 04:41 AM
Gnome: Auto mounting external devices as first user logged in, not current user yitzle Linux - Software 4 04-01-2008 09:43 AM
how can i change my Logged in name of this site sajidmumtaz LQ Suggestions & Feedback 7 07-05-2006 10:41 AM
Multi-user and 3D sharing, 3D only works for the first logged in user foxy123 SUSE / openSUSE 0 02-20-2005 04:31 AM
mozilla works fine when logged in as a user but crashes when logged in as root jimi Linux - General 6 04-02-2003 08:34 PM

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

All times are GMT -5. The time now is 04:14 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