[ad_1]
While studying Node.js, I found a tutorial that advice to change the ownership of /usr/lib by the command sudo chown -R `id -un`:`id -gn` /usr/lib
That was a big mistake because it brock my system (Kubuntu 20.04).
I tried to restore the ownership to root by the command:
sudo chown -R root:root /usr/lib
Note that sudo
is not working. So reboot the system into recovery mode and insert the console with root
privilege and execute:
chown -R root:root /usr/lib
Then restart to normal mode.
But applications that require authentication still not working. I spent three days searching for a solution but nothing work.
Finally, I got and Idea that solved the problem. I would like to share it in case anybody got the same problem and deos not want to re-install his/her Linux OS.
I did the following:
- Get the ownership of /usr/lib and sub-folders and files to root:root by the following command
sudo chown -R root:root /usr/lib
- Using VirtualBox to run a virtual machine for Kubuntu live.
- In side the virtual machine execute the command
find /usr/lib/ \( -perm -4000 \) -printf "%m %u:%g %p\n"
to get all the files with Setuid flag.
kubuntu@kubuntu:/usr/lib/xorg$ find /usr/lib/ \( -perm -4000 \) -printf "%m %u:%g %p\n"
4754 root:messagebus /usr/lib/dbus-1.0/dbus-daemon-launch-helper
4755 root:root /usr/lib/openssh/ssh-keysign
4755 root:root /usr/lib/eject/dmcrypt-get-device
6755 root:root /usr/lib/xorg/Xorg.wrap
4755 root:root /usr/lib/virtualbox/VirtualBoxVM
4755 root:root /usr/lib/snapd/snap-confine
4755 root:root /usr/lib/policykit-1/polkit-agent-helper-1
- Execute the
sudo chmod 4xxx <path/to/file>
to fix permissions on my system for all the files in previous step
sudo chmod u+s /usr/lib/virtualbox/VirtualBoxVM
sudo chown root:messagebus /usr/lib/dbus-1.0/dbus-daemon-launch-helper
sudo chmod 4754 /usr/lib/dbus-1.0/dbus-daemon-launch-helper
sudo chmod 4755 /usr/lib/eject/dmcrypt-get-device
sudo chmod 4755 /usr/lib/openssh/ssh-keysign
sudo chmod 4755 /usr/lib/policykit-1/polkit-agent-helper-1
sudo chmod 4755 /usr/lib/snapd/snap-confine
sudo chmod 6755 /usr/lib/xorg/Xorg.wrap
I am still not sure if the group ids for all files are correct.
Are there any ideas to solve this problem?
[ad_2]