change back owner of su


"I just did something like: “chown -R my-name /” I don’t know why!
Now I can’t be SU or anything…
PLEASEEEE is there anyway to fix this? (on OpenSuse 13.2)

You not only borked su, You borked all of your system.

Not easy to repair.

Hard to fix.

If you have a live image (live DVD or live USB of 13.2), then boot that. Mount the file systems from your installed system. Then try to fix the permissions. But it might be hard if you don’t know what the permissions are supposed to be. The permissions on the live image will give some sort of indication.

I’m not sure if there’s a script that knows the proper permissions and can reset them.

I vague remember that there is something like that. Probably something that checks against the RPM’ contents.

BTW, when his report is trustworthy, he did not change permissions, but only the ownership of all files in his system (which will probably leave only the files in his home directory unaffected).

This should automatically reset SUID and SGID bits. Not sure about sticky bits on directories.

rpm --setperms
rpm --setugids

But it does not accept wildcards as package names so should be applied to each package individually.

After that run chkstat to reapply whatever is set in /etc/permissions.

Oh yes.

Reinstalling may be faster and more secure I assume.

Is that the correct sequence? Wouldn’t the second again remove suid/sgid bits just set?

Yes, you are probably right; I listed them in no particular order.


Maybe try reading

man chkstat

before reinstalling everyting

Should you ever decide to resintall everything i suggest do it in a linux console e.g.

Ctrl + Alt + F1 to F6

Good luck.