Register
It is currently Mon May 21, 2018 10:43 am

An Interesting User Name UID problem


All times are UTC


Post new topic Reply to topic  [ 6 posts ] 
Author Message
 PostPosted: Fri Jul 08, 2011 10:19 pm   
Member

Joined: Thu Jul 16, 2009 9:58 pm
Posts: 177
Location: Loveland, CO
Here is an interesting user management problem that did not occur to me until it happened. I still do not know how to fix it!

Background: I run multiple Linux distributions.

Debian Squeeze/Gnome 2.30 - This one is the stable go-to system.

Arch Linux/Xfce 4.8 - a relatively new installation, but Arch is proving to be impressively smooth and at least to this point quite stable. I am enjoying Arch, thanks to timiller.

Fedora 15/Xfce 4.8 - This is the “third spot” that rotates. Fedora is the current third.

I always use Root, Home and Swap partitions. In addition I use a /data partition for my personal files. This is mounted to user/home/data. I use the same user name and password on each of the three systems.

Perhaps for that reason I am able to modify /etc/fstab so that I auto-mount /data on start-up. Given that I use the same user-name on all three systems I have never had a problem accessing documents on /data.

Until now. Now involves Fedora. (You might know ....) Try as I might I could not read anything on /data using Fedora 15. Clearly I had a permissions problem of a sort I had not seen before. But what? After all, all three systems had the same user named with the same set of permissions.

After much klutzing around the light went on . Suppose I had the same user name on each system but not the same UID?

Sure enough, issuing “id” at the cli confirmed it. Debian and Arch both assign initial usernames a UID of 1000 and this seems the most common practice, which is probably why this has not happened before. (My system has worked with Suse, Mepis, sidux/aptosid, LMDE, to name a few.)

Fedora seems to start users at 500, which is not at all the same thing whatever the username might say. So UserName on Debian set to 1000 and UserName on Fedora set to 500 are very different.

So if we set permissions to /data on one of these systems we will deny access to the same user name on the other system because the UIDs are different.

Now, how to change a UID so that each system uses the same UID? I have not found a way to do this, but surely there is a way. Anybody know it?

_________________
Debian Stable
antiX MX series


Top
 Profile  
 PostPosted: Sat Jul 09, 2011 9:06 am   
Moderator
User avatar

Joined: Sat Nov 15, 2003 10:24 pm
Posts: 2765
Location: The Diamond State
Did you try usermod?
Code:
usermod -u UID username

_________________
openSUSE 11.4 (i586)
PCLinuxOS 2009 -2.6.26.8.tex3


Top
 Profile  
 PostPosted: Sat Jul 09, 2011 4:56 pm   
Member

Joined: Thu Jul 16, 2009 9:58 pm
Posts: 177
Location: Loveland, CO
Just did "man usermod" and it looks like just the tool. Thanks Lynch!

OK Bill, you ain't so smart yet ..............

_________________
Debian Stable
antiX MX series


Top
 Profile  
 PostPosted: Sun Jul 10, 2011 9:13 am   
Moderator
User avatar

Joined: Sat Nov 15, 2003 10:24 pm
Posts: 2765
Location: The Diamond State
You are welcome! :)

_________________
openSUSE 11.4 (i586)
PCLinuxOS 2009 -2.6.26.8.tex3


Top
 Profile  
 PostPosted: Tue Jul 12, 2011 1:15 am   
Linux Guru
User avatar

Joined: Sat Apr 03, 2004 12:39 am
Posts: 12380
Location: Clinton Township, Michigan
lynch wrote:
Did you try usermod?
Code:
usermod -u UID username


I usually hand edit the file, but I really ought to start using usermod myself - I standardize on 1000 as the starting user ID (and group ID, for that matter).

_________________
Brian Masinick
Distros: MX-17, antiX, Debian


Top
 Profile WWW YIM  
 PostPosted: Tue Jul 12, 2011 7:17 pm   
Member

Joined: Thu Jul 16, 2009 9:58 pm
Posts: 177
Location: Loveland, CO
usermod works, only subject to the proviso that the UID being assigned is not otherwise in use. With Fedora that test was met. Masinick's strategy of always assigning UIDs starting with 1000 makes sense given that 1000 is the most common value I see.

I must say I was completely unaware of this entire issue and that probably explains why I did not know about usermod until lynch pointed to it.

_________________
Debian Stable
antiX MX series


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


Powered by phpBB © 2012 phpBB Group
© 2003 - 2012 USA LINUX USERS GROUP