0

Before anything I know that there is a similar question HERE.

When I execute:

sudo bash 

I get the following error:

/usr/bin/sudo must be owned by uid 0 and have the setuid bit set

However, there is a difference in my problem that does not permit me to solve it using that solution proposed as follows:

1. Log out as the current user, then log back in as root.
2. Execute chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo
3. Log out as root, then log back in as the current user. 

Because I cannot log in as root.

My question is how can I log in as root to do first step ?
i.e. 1. Log out as the current user, then log back in as root.

2 Answers2

1

You could boot from a USB thumb drive, mount your root file system and then chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo. After a reboot, sudo should be working again.

nagelp
  • 413
  • sudo is under /usr/bin/sudo, not /usr/sbin/sudo 2. If you mount the filesystem under for example /mnt, then the actual path will be /mnt/usr/bin/sudo.
  • – raj May 24 '22 at 22:05
  • Re 2: You're right, one would have to account for the mount prefix, thanks for pointing that out. Re 1: I didn't write /usr/sbin? – nagelp May 25 '22 at 05:10