This has happened with my two colleagues in this month. So thought of sharing which might help the needy.
People have a tendency to complete the work quickly and in that hurry, without looking at the Current Working Directory, just they press ENTER key after writing chown command.
By the time they realise the damage happens and screw happiness at work.
So in my colleagues' case something of this kind happend.
Thery were at the root (/) prompt and issued a chown command to get permission to their user.
After that whenever they issue command with sudo, they started getting the error message
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
and also the login screen was not appearing.
How to get rid of this now? I got the clue from bitmapcake and AskUbuntu
Thank you both. I added few steps to the ones mentioned in the above links
Reboot the system.
This should bring up the login screen.
People have a tendency to complete the work quickly and in that hurry, without looking at the Current Working Directory, just they press ENTER key after writing chown command.
By the time they realise the damage happens and screw happiness at work.
So in my colleagues' case something of this kind happend.
Thery were at the root (/) prompt and issued a chown command to get permission to their user.
After that whenever they issue command with sudo, they started getting the error message
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
and also the login screen was not appearing.
How to get rid of this now? I got the clue from bitmapcake and AskUbuntu
Thank you both. I added few steps to the ones mentioned in the above links
- Restart your PC
- While booting press SHIFT key
- Select Advanced Options
- Select recovery mode
- Select Drop to root shell prompt
- Press ENTER
- This will bring root shell for you
- Now issue the following commands
- mount -o remount, rw /
- mount --all
- chown root:root /usr/bin/sudo
- chmod 4755 /usr/bin/sudo
- chown root:root /etc/sudoers
- chmod 4755 /etc/sudoers
- chown root:root /etc/sudoers.d -R
- chmod 4755 /etc/sudoers.d
- sudo apt install gdm
- sudo apt install lightdm
- sudo dpkg-reconfigure gdm
Reboot the system.
This should bring up the login screen.
No comments:
Post a Comment