I have no idea of how the user got changed to 999 or if it is safe.
A folder in my system is showing the user as 999 and the other files and folders inside that folder have the root permission. I tried to change the folders permission to root using chown but it does not work. Please let me know how to change the folder's permission to root. The folder is not a system folder, it is more of a backup folder.
root@Gamers:~# chown -hR root /folder/name
root@Gamers:~# ls
drwsr-xr-x 4 999 1M Feb 25 21:25 /folder/name
root@Gamers:~# grep '^\w*:\w*:999' /etc/passwd
root@Gamers:-#
To change the owner and group of a file/directory (non-recursively) to root, you simply type
Note that
chown
must be run with root privileges (therefore the use ofsudo
).Whether it is a good idea in your case to change the owner of that directory to root or not (or something else) depends on what its purpose is and who user 999 is, if it exists.
Some light on this question could be shed by the output of
I just answered a very similar question on SuperUser. You can see that answer for more information, but here are the parts relative to this question.
It is perfectly safe to have files and directories assigned the 999 user. The 999 user is used for MySQL in some distros. You mention that this is not a system folder, but a backup. If your distro is not using the 999 user, then it is possible that the directory is backed up from another machine, not the machine that you are currently running.