Reputation: 943
How do you fix the permissions in /usr after sudo chown root -R /usr
?
I managed to fix sudo using this but how should I fix the rest?
Upvotes: 1
Views: 1685
Reputation: 3887
Most files on /usr
are owned by root
, so it should have not changed many files.
As you says that sudo
has lost its setuid
bit, all commands on /usr/
that had it must have lost it too. You will probably notice it when you try to run them, so you can add it to them again.
Edit:
I'm giving you some info about /usr
on my personal machine that may help you to recover. I am using Ubuntu 14.04.
On my machine, all files under /usr
are owned by root
, except /usr/sbin/uuidd
, which is owned by libuuid
(and setuid
to that user):
-rwsr-sr-x 1 libuuid libuuid 18904 ago 5 04:20 /usr/sbin/uuidd*
I also have the following files setuid
, all by root
, except the one I told you above:
/usr/sbin/uuidd
/usr/sbin/pppd
/usr/bin/passwd
/usr/bin/lppasswd
/usr/bin/sudo
/usr/bin/chsh
/usr/bin/newgrp
/usr/bin/traceroute6.iputils
/usr/bin/beep
/usr/bin/X
/usr/bin/chfn
/usr/bin/pkexec
/usr/bin/mtr
/usr/bin/gpasswd
/usr/lib/openssh/ssh-keysign
/usr/lib/chromium-browser/chrome-sandbox
/usr/lib/eject/dmcrypt-get-device
/usr/lib/policykit-1/polkit-agent-helper-1
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/pt_chown
/usr/lib/x86_64-linux-gnu/oxide-qt/chrome-sandbox
Upvotes: 5