LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 11-18-2009, 08:00 AM   #1
prollocks
LQ Newbie
 
Registered: May 2006
Distribution: Arch 64
Posts: 24

Rep: Reputation: 0
Question Files have owner as uid number rather than username


Hello all,

On my RHES4 I noticed a load of files which had owner set as the owners uid rather than the actual username - is this usual behaviour ?

On a similar system the same files actually have the username as the owner.

It's just causing me issues as I have changed the users ID and now some thing's wont start meaning I have to manually do a find and chown on the system.

Cheers

Prollocks
 
Old 11-18-2009, 08:06 AM   #2
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 52
Is this not caused by you changing the user ID? The ID will show if there is no user matching that ID, for example I had the same thing when I moved a home partition from one system to another because on the first system UID 1001 was associated with the user bob, but on system 2 there was no user bob so it just showed as 1001.
 
Old 11-18-2009, 10:07 AM   #3
prollocks
LQ Newbie
 
Registered: May 2006
Distribution: Arch 64
Posts: 24

Original Poster
Rep: Reputation: 0
Most probably right - but if a users ID is changed surely his files should still belong to him rather than his old ID? (on the same machine that is)
 
Old 11-18-2009, 10:20 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Slackware 13.37, Debian Squeeze
Posts: 7,964
Blog Entries: 25

Rep: Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006
Quote:
Originally Posted by prollocks View Post
Most probably right - but if a users ID is changed surely his files should still belong to him rather than his old ID? (on the same machine that is)
Perhaps it should but that is not the way UNIX and Linux are designed. If you want that you can do it with the find command using the -user option to identify the files-and-directories and the -exec option with the chown command.
 
Old 11-18-2009, 07:08 PM   #5
chrism01
Guru
 
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.2, Centos 5.8
Posts: 11,696

Rep: Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900
Note that in reality, all file ownerships (user & group) are recorded by uid/gid. The name just appears when you do an ls -l if(!) there are matching entries in /etc/passwd & /etc/group. Just like DNS, names are for humans only; the system always uses numbers.

If you used usermod to alter the uid, then
Quote:
-u, --uid UID
The numerical value of the user's ID. This value must be unique, unless the -o option is used. The value must be non-negative. Values between 0 and 999 are typically reserved for system accounts. Any files which the user owns and which are located in the directory tree rooted at the user's home directory will have the file user ID changed automatically. Files outside of the user's home directory must be altered manually.
If you did it manually (ie edited /etc/passwd) then nothing else is updated.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ps -ef shows UID rather than username bazzagazza Linux - Newbie 5 05-10-2007 04:16 AM
Obtaining uid from username JPrieSL Programming 4 04-20-2007 08:31 AM
OpenLdap PAM UID vs Username Authentication zerovice Linux - Enterprise 0 12-05-2005 09:38 PM
Getting uid and/or username of logged in user rjstephens Programming 5 09-23-2004 05:02 PM
uid battle: Apache v/s script's owner kires Linux - Networking 3 01-19-2004 03:43 PM


All times are GMT -5. The time now is 07:56 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration