Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] sudo can't be used after hardening the machine #544

Closed
GauthierPLM opened this issue Dec 17, 2024 · 2 comments · Fixed by #545
Closed

[BUG] sudo can't be used after hardening the machine #544

GauthierPLM opened this issue Dec 17, 2024 · 2 comments · Fixed by #545
Assignees

Comments

@GauthierPLM
Copy link

Describe the bug
I receive the following error after running the hardening script on Ubuntu 24.04:

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

To Reproduce

  1. Setup a fresh ubuntu 24.04 machine.
  2. Change SSH port to 12322 (or any other port)
  3. use any as FW_ADMIN value.
  4. run sudo bash ubuntu.sh
  5. once completed, try to run a command using sudo (ex: sudo reboot). The command will be rejected with the error above

Expected behavior

The sudo command should work as expected.

System (lsb_release -a):

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 24.04.1 LTS
Release:	24.04
Codename:	noble

Additional context

/usr/bin$ ls -ln sudo
-rwxr-xr-x 1 0 0 335120 Apr  8  2024 sudo
@GauthierPLM
Copy link
Author

Temporary solution:

  • run the hardening as root and run chmod 4755 /usr/bin/sudo
  • use a rescue mode to access the system and run the above command.

@konstruktoid
Copy link
Owner

Thank you @GauthierPLM for reporting this.
sudo was added by mistake in 70d66b2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants