Cannot Use sudo  [Solved]

Help for Current Versions of MX
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
User avatar
showdonttell
Posts: 8
Joined: Wed Jun 17, 2020 6:30 pm

Cannot Use sudo

#1 Post by showdonttell »

Hello,

This is probably a silly question, but it is frustrating me and I cannot seem to solve it. When I installed MX this latest time, I guess I didn't set up a set up my user account to be able to use sudo, so I just used su and did what I needed to do as root. I can't seem to get sudo working for my user account. Have seen some things that recommend appending the sudoers file, but I am not sure what to set exactly.

This is what happens:

Code: Select all

$ sudo echo 123
Sorry, user showdonttell is not allowed to execute '/usr/bin/echo 123' as root on my-machine.
Sorry, this is probably a simple fix, I just can't seem to figure it out.

Code: Select all

System:    Kernel: 5.10.0-24-amd64 [5.10.179-5] x86_64 bits: 64 compiler: gcc v: 10.2.1 
           parameters: BOOT_IMAGE=/boot/vmlinuz-5.10.0-24-amd64 root=UUID=<filter> ro quiet splash 
           Desktop: Xfce 4.18.1 tk: Gtk 3.24.24 info: xfce4-panel wm: xfwm 4.18.0 vt: 7 
           dm: LightDM 1.26.0 Distro: MX-21.3_x64 Wildflower January 15  2023 
           base: Debian GNU/Linux 11 (bullseye) 
Machine:   Type: Laptop System: HP product: HP EliteBook 840 G5 v: N/A serial: <filter> Chassis: 
           type: 10 serial: <filter> 
           Mobo: HP model: 83B2 v: KBC Version 04.6D.00 serial: <filter> UEFI: HP 
           v: Q78 Ver. 01.20.00 date: 03/21/2022 
Battery:   ID-1: BAT0 charge: 25.3 Wh (72.3%) condition: 35.0/50.2 Wh (69.6%) volts: 12.5 
           min: 11.6 model: Hewlett-Packard Primary type: Li-ion serial: <filter> status: Charging 
           cycles: 211 
CPU:       Info: Quad Core model: Intel Core i7-8550U bits: 64 type: MT MCP arch: Kaby Lake 
           note: check family: 6 model-id: 8E (142) stepping: A (10) microcode: F4 cache: 
           L2: 8 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 31999 
           Speed: 700 MHz min/max: 400/4000 MHz Core speeds (MHz): 1: 700 2: 700 3: 700 4: 723 
           5: 700 6: 701 7: 701 8: 704 
           Vulnerabilities: Type: gather_data_sampling mitigation: Microcode 
           Type: itlb_multihit status: KVM: VMX disabled 
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
           Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
           Type: meltdown mitigation: PTI 
           Type: mmio_stale_data mitigation: Clear CPU buffers; SMT vulnerable 
           Type: retbleed mitigation: IBRS 
           Type: spec_rstack_overflow status: Not affected 
           Type: spec_store_bypass 
           mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: IBRS, IBPB: conditional, STIBP: conditional, RSB filling, 
           PBRSB-eIBRS: Not affected 
           Type: srbds mitigation: Microcode 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Intel UHD Graphics 620 vendor: Hewlett-Packard driver: i915 v: kernel 
           bus-ID: 00:02.0 chip-ID: 8086:5917 class-ID: 0300 
           Device-2: Cheng Uei Precision Industry (Foxlink) HP HD Camera type: USB 
           driver: uvcvideo bus-ID: 1-9:4 chip-ID: 05c8:0808 class-ID: 0e02 serial: <filter> 
           Display: x11 server: X.Org 1.20.11 compositor: xfwm4 v: 4.18.0 driver: 
           loaded: modesetting unloaded: fbdev,vesa display-ID: :0.0 screens: 1 
           Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x286mm (20.0x11.3") 
           s-diag: 583mm (23") 
           Monitor-1: eDP-1 res: 1920x1080 hz: 120 dpi: 158 size: 309x174mm (12.2x6.9") 
           diag: 355mm (14") 
           OpenGL: renderer: Mesa Intel UHD Graphics 620 (KBL GT2) v: 4.6 Mesa 20.3.5 
           direct render: Yes 
Audio:     Device-1: Intel Sunrise Point-LP HD Audio vendor: Hewlett-Packard driver: snd_hda_intel 
           v: kernel alternate: snd_soc_skl bus-ID: 00:1f.3 chip-ID: 8086:9d71 class-ID: 0403 
           Sound Server-1: ALSA v: k5.10.0-24-amd64 running: yes 
           Sound Server-2: PulseAudio v: 14.2 running: yes 
Network:   Device-1: Intel Ethernet I219-V vendor: Hewlett-Packard driver: e1000e v: kernel 
           port: efa0 bus-ID: 00:1f.6 chip-ID: 8086:15d8 class-ID: 0200 
           IF: eth0 state: down mac: <filter> 
           Device-2: Intel Wireless 8265 / 8275 driver: iwlwifi v: kernel modules: wl port: efa0 
           bus-ID: 01:00.0 chip-ID: 8086:24fd class-ID: 0280 
           IF: wlan0 state: up mac: <filter> 
Bluetooth: Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8 
           bus-ID: 1-7:2 chip-ID: 8087:0a2b class-ID: e001 
           Report: hciconfig ID: hci0 rfk-id: 72 state: up address: <filter> bt-v: 2.1 lmp-v: 4.2 
           sub-v: 100 hci-v: 4.2 rev: 100 
           Info: acl-mtu: 1021:4 sco-mtu: 96:6 link-policy: rswitch hold sniff 
           link-mode: slave accept service-classes: rendering, capturing, object transfer, audio 
Drives:    Local Storage: total: 476.94 GiB used: 71.98 GiB (15.1%) 
           SMART Message: Unable to run smartctl. Root privileges required. 
           ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Toshiba model: N/A size: 476.94 GiB 
           block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD 
           serial: <filter> rev: AAHA4102 temp: 46.9 C scheme: GPT 
Partition: ID-1: / raw-size: 468.68 GiB size: 460.25 GiB (98.20%) used: 71.77 GiB (15.6%) fs: ext4 
           dev: /dev/nvme0n1p2 maj-min: 259:2 
           ID-2: /boot/efi raw-size: 256 MiB size: 252 MiB (98.46%) used: 282 KiB (0.1%) fs: vfat 
           dev: /dev/nvme0n1p1 maj-min: 259:1 
Swap:      Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default) 
           ID-1: swap-1 type: partition size: 8 GiB used: 207.8 MiB (2.5%) priority: -2 
           dev: /dev/nvme0n1p3 maj-min: 259:3 
Sensors:   System Temperatures: cpu: 50.0 C mobo: 47.0 C 
           Fan Speeds (RPM): N/A 
Repos:     Packages: note: see --pkg apt: 2492 lib: 1312 flatpak: 0 
           No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb http://deb.debian.org/debian bullseye-updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb http://deb.debian.org/debian bullseye main contrib non-free
           2: deb http://security.debian.org/debian-security bullseye-security main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb http://mxlinux.mirrors.uk2.net/packages/mx/repo/ bullseye main non-free
           Active apt repos in: /etc/apt/sources.list.d/protonvpn-stable.list 
           1: deb [arch="all", signed-by=/usr/share/keyrings/protonvpn-stable-archive-keyring.gpg] https://repo.protonvpn.com/debian stable main
           Active apt repos in: /etc/apt/sources.list.d/signal-xenial-added-by-mxpi.list 
           1: deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main
           Active apt repos in: /etc/apt/sources.list.d/spotify.list 
           1: deb http://repository.spotify.com stable non-free
           Active apt repos in: /etc/apt/sources.list.d/vivaldi.list 
           1: deb [arch=amd64] https://repo.vivaldi.com/stable/deb/ stable main
Info:      Processes: 276 Uptime: 49d 3h 59m wakeups: 9803 Memory: 15.47 GiB 
           used: 5.76 GiB (37.3%) Init: SysVinit v: 2.96 runlevel: 5 default: 5 tool: systemctl 
           Compilers: gcc: N/A alt: 10 Client: shell wrapper v: 5.1.4-release inxi: 3.3.06 
Boot Mode: UEFI

User avatar
dolphin_oracle
Developer
Posts: 22685
Joined: Sun Dec 16, 2007 12:17 pm

Re: Cannot Use sudo

#2 Post by dolphin_oracle »

please show output of "groups" command.
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/

Charlie Brown

Re: Cannot Use sudo

#3 Post by Charlie Brown »

You can also use "MX User Manager" , last 2 tabs, either to have a look whether such a group exists and whether you're in that (sudo) group, check if it's un-checked, "Apply".

User avatar
showdonttell
Posts: 8
Joined: Wed Jun 17, 2020 6:30 pm

Re: Cannot Use sudo

#4 Post by showdonttell »

dolphin_oracle wrote: Sat Oct 14, 2023 6:18 pm please show output of "groups" command.
Here's what I have:

Code: Select all

$ groups
showdonttell lp dialout cdrom floppy audio dip video plugdev users netdev lpadmin vboxsf scanner sambashare
Charlie Brown wrote: Sat Oct 14, 2023 10:18 pm You can also use "MX User Manager" , last 2 tabs, either to have a look whether such a group exists and whether you're in that (sudo) group, check if it's un-checked, "Apply".
Yeah, I looked there and see that there is a sudo group. It is checked for my user in the MX utility, but does not appear in the groups command output, above, which seems strange to me...

User avatar
dolphin_oracle
Developer
Posts: 22685
Joined: Sun Dec 16, 2007 12:17 pm

Re: Cannot Use sudo  [Solved]

#5 Post by dolphin_oracle »

Code: Select all

usermod -a -G sudo showdonttell
from a root prompt should do it.
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/

User avatar
showdonttell
Posts: 8
Joined: Wed Jun 17, 2020 6:30 pm

Re: Cannot Use sudo

#6 Post by showdonttell »

dolphin_oracle wrote: Sun Oct 15, 2023 8:31 am

Code: Select all

usermod -a -G sudo showdonttell
from a root prompt should do it.
Thanks, I had to log out and log back in, but groups now shows sudo is included.

Post Reply

Return to “MX Help”