Owner of file changed to number

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Earlier today someone had a problem where all the files in their directories that were previously owned by their username instead showed a number.

There are a few things that could cause this. The first is that if you delete a user from a server and that user has files that are still remaining on the server, then it will default the the owners user number, instead of their username (since they no longer exist).

The second way this could happen would be if someone edited the number of the user by going into /etc/passwd and changing it to a different number. The files are now associated with a number that has no user and thus it doesnt know the name of the owner so it just defaults to the number that last owned them.

To resolve this you can go into the base directory that you want the owner of the files changed and type the following command in a shell (might use telnet or ssh and probably need root permission):

chmod -R username.usergroup ./

That will effectively change the user and group of all the files under that directory recursively. If you wish to just change one file or directory you could type:

chmod username.usergroup filename

You can also type less if you want to keep the group owner to what it was before:

chmod username filename
-or-
chmod -R username ./
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Borrow -A- Geek
  • Professor
  • Professor
  • User avatar
  • Posts: 763
  • Loc: Dallas/Ft Worth, Texas

Post 3+ Months Ago

Excellent Post sir. i actually had a situation where my files created on the fly by a php script were being owned by 99 . i had no idea why the script was owning them to this owner but that makes sense now... what was weird about it is that if they were owned by "99" i had no access to these files.. probably because it was owned byt user nobody..

thanks
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

i know that I know the name, but where oh where do I know it from?
gadget guru...hmm....it'll come to me, I'm sure....
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Gadget Guru wrote:
Excellent Post sir. i actually had a situation where my files created on the fly by a php script were being owned by 99 . i had no idea why the script was owning them to this owner but that makes sense now... what was weird about it is that if they were owned by "99" i had no access to these files.. probably because it was owned byt user nobody..

thanks


That could be, the user nobody on my server has an ID of 99, but if someone were to remove that user than it would show 99 instead of nobody I believe.
  • barry
  • Graduate
  • Graduate
  • User avatar
  • Posts: 115
  • Loc: scotland

Post 3+ Months Ago

[quote="Bigwebmaster"]Earlier today someone had a problem where all the files in their directories that were previously owned by their username instead showed a number.

There are a few things that could cause this. The first is that if you delete a user from a server and that user has files that are still remaining on the server, then it will default the the owners user number, instead of their username (since they no longer exist).

The second way this could happen would be if someone edited the number of the user by going into /etc/passwd and changing it to a different number. The files are now associated with a number that has no user and thus it doesnt know the name of the owner so it just defaults to the number that last owned them.

To resolve this you can go into the base directory that you want the owner of the files changed and type the following command in a shell (might use telnet or ssh and probably need root permission):

[color=red]chmod -R username.usergroup ./[/color]

That will effectively change the user and group of all the files under that directory recursively. If you wish to just change one file or directory you could type:

[color=red]chmod username.usergroup filename[/color]

You can also type less if you want to keep the group owner to what it was before:

[color=red]chmod username filename[/color]
-or-
[color=red]chmod -R username ./[/color][/quote]


I must be stupid becasue i dont understand the bit above...

Please help i have 300 images i need to download from my server that are all owner 99

I am refering to the section above

[color=red]chmod username.usergroup filename[/color]


i am using cuteftp and i am entering this into my "input ftp command" box

chmod -R photos

photos being the folder name

and it comes back saying

COMMAND:> chmod -R photos
550 Could not change perms on photos ./: No such file or directory
ERROR:> Requested action not taken (e.g., file or directory not found, no access).


so i tried this instead when i was inside the folder

chmod -R 11111.jpg

and still no joy ?


please help

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 10 guests
  • 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.