Skip to content

Instantly share code, notes, and snippets.

@LakshyaGarg
Last active August 22, 2018 11:26
Show Gist options
  • Save LakshyaGarg/a2cfd0d262f0a805846fe58b3c346d96 to your computer and use it in GitHub Desktop.
Save LakshyaGarg/a2cfd0d262f0a805846fe58b3c346d96 to your computer and use it in GitHub Desktop.
Steps for changing owner and permissions of /usr/bin/sudo to root again
### when we see the error "sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set", then there is no need to reinstall the os, following is the workaround
Steps:
1) login to recovery mode
2) mount -o remount,rw / #recovery mode defaults to mounting / as read-only. you need to remount it before you can change permissions
3) chown -R root:root /usr/ #change the owner of /usr to root, if changed to any other user
4) chmod 4755 /usr/bin/sudo #change the permission of /usr/bin/sudo to 4755
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment