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.
/etc
but/usr
, my principal problem is that/usr/bin/sudo
is now owned by another user thanroot
– Mouradif Oct 09 '17 at 12:56/usr
and you ran with the-R
flag.sudo
doesn't work if youchown
/etc
. Use this procedure and replace/etc
with/usr
in the commands – Zanna Oct 09 '17 at 12:58/usr/bin/sudo
is 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