Debian 9: can't use sudo
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.
Related videos on Youtube
MKM
Updated on September 18, 2022Comments
-
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 almost 7 yearsI 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 almost 7 years
-
Michael Homer almost 7 yearsAlso, bug report
-
SlySven almost 7 yearsI would reiterate, if you are going to edit
/etc/sudoers
thenvisudo
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 willsudo
and that will lock you out of using sudo to, er, do the things that it is essential to use it for... -
Bob Eager almost 7 yearsI don't disagree. And that is obvious to anyone looking at the
sudoers
file. -
JdeBP almost 7 yearsIt 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 over 6 yearsIt'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 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'tsu
; any solution that starts by assuming they have root isn't going to help them -
mchid over 4 yearsYou have to use the root user password when you execute
su
not your user's password.