After running the (stupid) command :
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
Having $(npm config get prefix) being equal to /usr, I have changed the ownership of /usr/bin/sudo to my administrative user. Now when I try to sudo I get the following error :
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
It was a fresh Ubuntu installation so I don't mind reinstalling but if there is another way I'm in. Note that I had not set a password for root so I believe I have no way to login as root. If I could it would be great, I would just chown -R root:root /usr/bin and it would fix my problem.
My /etc/ folder is still owned by root and everything works fine except sudo giving the above error message.
/etcbut/usr, my principal problem is that/usr/bin/sudois now owned by another user thanroot– Mouradif Oct 09 '17 at 12:56/usrand you ran with the-Rflag.sudodoesn't work if youchown/etc. Use this procedure and replace/etcwith/usrin the commands – Zanna Oct 09 '17 at 12:58/usr/bin/sudois not enough. And obviously the linked post suggests booting a live session, because there's no other way to fix it – Zanna Oct 10 '17 at 05:21