18
orhun
5y

Accidentally (SOMEHOW):

sudo chown <user> -hR /usr/bin/

Tries to run "sudo su" after 12 hours:

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

...

it was at this moment that he knew, he f'd up

Comments
  • 4
    Oof

    Time to login as root I guess :p

    In case this is a vps
  • 7
    If sudo is now owned by you, you should be able to own it back to root.
  • 3
    Root and uid are deep integrated into sudo/su
  • 5
    @stop New plan: Rewrite sudo from scratch using your own username and then fix the server :)
  • 0
    @Shiggy most likely not as being able to set ownership to someone else would be a gross security risk.
  • 1
    @Voxera what's the security risk there?
  • 0
    @Voxera to be fair, he did use 'sudo chown': root said so, so the system executed the command. The new file owner should now be allowed to do whatever it wants with the file, including returning it to root.
  • 1
    @endor 'root said so' sounds so like a mother
  • 0
    @Shiggy not 100 % sure but I do know that some programs can bi flagged to run as the owner instead of as the user.

    If you could set that flag and then change owner ...

    Not sure if this is possible, but I also cannot se why you should be able to change owner to some one you do not have access to.

    But I could be wrong. Have not done to much linux admin the last 8-10 years.
  • 0
    I tried it on a current Ubuntu system and it doesn't work.
Add Comment