Can't use su or sudo on Arch Linux

5,302

For some reason you do not have the the setuid bit set on your su and sudo executables. This bit is required so that su and sudo can elevate you to run as the root user. You can restore the setuid bit by using chmod as root:

chmod u+s "$(command -v su)" "$(command -v sudo)"
Share:
5,302

Related videos on Youtube

Mahmoud Hossam
Author by

Mahmoud Hossam

Updated on September 18, 2022

Comments

  • Mahmoud Hossam
    Mahmoud Hossam over 1 year

    Sudo returns this error:

    sudo: effective uid is not 0, is sudo installed setuid root?
    

    And su - returns this:

    su: Authentication failure
    

    The user I'm using is a member of the following groups:

    disk wheel locate network video audio optical floppy storage power users
    

    I can log in to root, but can't elevate my user privileges, and I'm sure the password I'm giving to both is correct.

    • clerksx
      clerksx over 11 years
      What is the output of stat "$(command -v su)" "$(command -v sudo)"?
    • Mahmoud Hossam
      Mahmoud Hossam over 11 years
      @ChrisDown here it is pastebin.com/Rk5y3bMU
  • Gilles 'SO- stop being evil'
    Gilles 'SO- stop being evil' over 11 years
    @MahmoudHossam Note that this may be just the tip of the iceberg. You really should figure out why su and sudo have the wrong permissions and fix that. There may be other files with wrong permissions or other problems.
  • Mahmoud Hossam
    Mahmoud Hossam over 11 years
    @Gilles I've been using the system for about a week now, nothing seems to be wrong with it for now, but thanks for the suggestion anyway.