"/" has a user not root as owner

As sometime, I must have screwed up and chown “/” to user:user, from root:root.

drwxr-xr-x. 18 wbs wbs 8192 May 1 09:48 .
drwxr-xr-x. 18 wbs wbs 8192 May 1 09:48 …

Any issue if I chown root:root / ??

I suppose not, as long as you did not “chown -R /”
On my system, the root folder has permissions dr-xr-xr-x.

The root folder “originates” from package “filesystem”, if you type
“rpm -V filesystem”, the permissions of 17297 folders will be checked.
In your case:

[root@pcbeneden hj]# rpm -V filesystem
.M...UG..    /
[root@pcbeneden hj]# chmod u-w /
[root@pcbeneden hj]# chown root:root /
[root@pcbeneden hj]# rpm -V filesystem
[root@pcbeneden hj]# 

1 Like

Yes, major problems.
Was the change done only in the / directory or was it done recursively so it affects the entire system?

If only contained to the / directory ( ls -l / shows the changes but ls -l /usr does not ) then it is relatively simple to fix.
If done recursively then it is almost mandatory to do a new clean reinstall in order to recover.

The post above shows a quick way to check

The rpm command has an option to fix file system permissions. For example

rpm --restore  filesystem

to fix files and directories owned by the package filesystem.

To fix everything you can run

rpm --restore -a

That will run for quite some time.

1 Like

No only "".

everything else is owned by root:root
Thanks Jeff.

ran:

[root@mcq maps]# rpm -V  filesystem
.M...UG..    /
[root@mcq maps]# ls /

then followed your steps.

then ran:

[root@mcq maps]# rpm -V  filesystem
[root@mcq maps]#
[root@mcq /]# ls -al
total 52
dr-xr-xr-x.  18 root root 8192 May  1 09:48 .
dr-xr-xr-x.  18 root root 8192 May  1 09:48 ..
dr-xr-xr-x    2 root root    6 Jan 18 19:00 afs
dr-xr-xr-x.   5 root root 4096 Apr 29 04:37 boot
drwxr-xr-x   21 root root 4140 May  1 04:52 dev
drwxr-xr-x. 143 root root 8192 May  1 09:36 etc
drwxr-xr-x.  17 root root  276 Jan 18 19:00 home

Thanks!

1 Like

Great to know why I really screw something up… :slight_smile:

Thanks