Debian 9: can't use sudo

53,899

Solution 1

It seems you have been bitten by a bug in the Debian 9 installer, as described in this forum topic: http://forums.debian.net/viewtopic.php?f=17&t=133604

There's a workaround given in the (currently) last post in that thread.

As I recall, the sudo command is not configured in Debian unless there is no root password given on install. Formerly, the sudo command was not even installed by default in Debian.

Solution 2

It sounds like you may not have added your non-root user to the list of sudoers. See man sudoers for details on this.

As for the second question, are you certain that you are using root's password? Unlike sudo, which asks for your password, su will ask for the password of the user to which you are switching.

Share:
53,899

Related videos on Youtube

MKM
Author by

MKM

Updated on September 18, 2022

Comments

  • MKM
    MKM over 1 year

    I've recently installed Debian 9 and encountered the following error.

    During installation I've set up 'root' password and I've set up 'user' with his own password. Later when I log into 'user' account and want to install some package I have this problem. If I run:

    sudo apt-get install 'package'
    

    then I get this message:

    'user' is not in sudoers list
    

    And if I try to log into 'root' terminal with:

    su
    

    and enter password, I get:

    su: Authentification error
    

    P.S. I understand that question may be really silly, but I've not found any information about it in internet, so I need to ask it here.

  • Bob Eager
    Bob Eager almost 7 years
    I rather assumed he would read the manual page, and/or the actual file - which on my system at least have dire warnings that you must use visudo! I have no idea why my correct answer was downvoted.
  • Michael Homer
    Michael Homer almost 7 years
    I think this post (linked from the thread you linked) is more relevant. You should edit in the salient points to your answer, because links can break.
  • Michael Homer
    Michael Homer almost 7 years
    Also, bug report
  • SlySven
    SlySven almost 7 years
    I would reiterate, if you are going to edit /etc/sudoers then visudo is designed to stop you shooting yourself in the foot - if it thinks there is an error in the file after your edit it but before it is finally saved then so will sudo and that will lock you out of using sudo to, er, do the things that it is essential to use it for...
  • Bob Eager
    Bob Eager almost 7 years
    I don't disagree. And that is obvious to anyone looking at the sudoers file.
  • JdeBP
    JdeBP almost 7 years
    It is a bug in the Debian 9 installer that is hitting people at the moment, as mentioned, but not explained properly, in another answer.
  • W.Jackson
    W.Jackson over 6 years
    It's a known bug in the installer. bugs.debian.org/cgi-bin/bugrepo ... bug=866206 edit: IMO the easiest way to fix this is - 1. When grub starts, hit 'e' to edit the startup environment. 2. In the editor, find the line that starts with 'linux' and add CODE: SELECT ALL init=/bin/bash to the end of that line and hit esc or F10 to boot the machine. 3. Next, remount your root filesystem read-write like this - CODE: SELECT ALL mount -no remount,rw / 4. Change root's password like this - CODE: SELECT ALL passwd root 5. Reboot. Done :)
  • Michael Mrozek
    Michael Mrozek over 6 years
    "I have no idea why my correct answer was downvoted." Probably because you're telling somebody without root access to run a command only root can run. They can't sudo and they can't su; any solution that starts by assuming they have root isn't going to help them
  • mchid
    mchid over 4 years
    You have to use the root user password when you execute su not your user's password.