1

I have installed Debian 10 on Dell Inspiron with an AMD processor. I am using the KDE Plasma desktop. When I try

sudo dpkg  -i ./palemoon_28.6.1+repack-2_amd64.deb

I get

[sudo] password for peter: 
peter is not in the sudoers file.  This incident will be reported.

I logged in as root and entered

/usr/sbin/adduser peter

This returned

adduser: The user `peter' already exists.

I then tried the following as root

chmod 0440 /etc/sudoers

When I try to sudo, in the peter account, I still get

peter is not in the sudoers file.  This incident will be reported.

I then try the following as root

sudo usermod -aG sudo,adm peter

Still get the same reslt when I try to sudo from the peter account.

Opening a new terminal, for the peter account, does not change anything.

Edit

cat /etc/sudoers
root@debian:/home/peter/Downloads# cat /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:    /usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d


root@debian:/home/peter/Downloads# id peter
uid=1000(peter) gid=1000(peter)   groups=1000(peter),4(adm),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),109(netdev),112(bluetooth),116(lpadmin),117(scanner)
6
  • What's in /etc/sudoers? What groups is your user in? Aug 18, 2019 at 23:34
  • The problem is sudo use its own settings to decide whether a user can run a command. Aug 18, 2019 at 23:36
  • 1
    Add the output of cat /etc/sudoers and id peter to your question. Also, /etc/sudoers already has 440 permissions so there's no need to run chmod on it. Aug 18, 2019 at 23:48
  • Thank you for your replies. I have edited my question to include the output of "cat /etc/sudoers" and "id peter" Aug 19, 2019 at 0:29
  • Try newgrp sudo in that new window, then the sudo command.
    – Jeff Schaller
    Aug 19, 2019 at 0:55

1 Answer 1

0

As root, I created a file

vi /etc/sudoers.d/peter

and added

peter    ALL=(ALL:ALL) ALL

I can now sudo from the peter account.

Not the answer you're looking for? Browse other questions tagged or ask your own question.