How do I edit the Sudo lecture messages?

Hello, I've noticed that when failing a password in sudo, will result in various messages, i've looked around and can't seem to find what's causing this to read it's documentation.

I'm curious how to edit, remove, or add some of these, if I could be pointed in a direction that'd be wonderful.

  Kernel: 6.1.9-zen1-2-zen arch: x86_64 bits: 64 compiler: gcc v: 12.2.1
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=d1f79207-835b-4b69-b454-bbced7227a9b rw [email protected]
    quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
    systemd.unified_cgroup_hierarchy=1 loglevel=3 ibt=off amd_iommu=on
  Desktop: KDE Plasma v: 5.26.5 tk: Qt v: 5.15.8 info: latte-dock
    wm: kwin_x11 vt: 1 dm: SDDM Distro: Garuda Linux base: Arch Linux
  Type: Desktop Mobo: ASUSTeK model: ROG STRIX B450-F GAMING v: Rev 1.xx
    serial: <superuser required> UEFI: American Megatrends v: 4007
    date: 12/08/2020
  Info: model: AMD Ryzen 7 2700 bits: 64 type: MT MCP arch: Zen+ gen: 2
    level: v3 note: check built: 2018-21 process: GF 12nm family: 0x17 (23)
    model-id: 8 stepping: 2 microcode: 0x800820D
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
    L1: 768 KiB desc: d-8x32 KiB; i-8x64 KiB L2: 4 MiB desc: 8x512 KiB
    L3: 16 MiB desc: 2x8 MiB
  Speed (MHz): avg: 3356 high: 3400 min/max: 1550/3400 boost: disabled
    scaling: driver: acpi-cpufreq governor: performance cores: 1: 3204 2: 3274
    3: 3368 4: 3390 5: 3393 6: 3367 7: 3400 8: 3400 9: 3204 10: 3381 11: 3400
    12: 3386 13: 3393 14: 3379 15: 3383 16: 3380 bogomips: 108586
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities: <filter>
  Device-1: NVIDIA TU117 [GeForce GTX 1650] vendor: Gigabyte driver: nvidia
    v: 525.85.05 alternate: nouveau,nvidia_drm non-free: 525.xx+
    status: current (as of 2023-02) arch: Turing code: TUxxx
    process: TSMC 12nm FF built: 2018-22 pcie: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 08:00.0 chip-ID: 10de:1f82 class-ID: 0300
  Display: x11 server: X.Org v: 21.1.7 with: Xwayland v: 22.1.7
    compositor: kwin_x11 driver: X: loaded: nvidia gpu: nvidia display-ID: :0
    screens: 1
  Screen-1: 0 s-res: 3840x1080 s-dpi: 101 s-size: 966x272mm (38.03x10.71")
    s-diag: 1004mm (39.51")
  Monitor-1: DP-0 pos: primary,right res: 1920x1080 hz: 60 dpi: 102
    size: 476x267mm (18.74x10.51") diag: 546mm (21.49") modes: N/A
  Monitor-2: HDMI-1 pos: left res: 1920x1080 hz: 60 dpi: 102
    size: 476x267mm (18.74x10.51") diag: 546mm (21.49") modes: N/A
  API: OpenGL v: 4.6.0 NVIDIA 525.85.05 renderer: NVIDIA GeForce GTX
    1650/PCIe/SSE2 direct-render: Yes
  Device-1: NVIDIA vendor: Gigabyte driver: snd_hda_intel bus-ID: 1-8:3
    v: kernel chip-ID: 0d8c:0005 pcie: class-ID: 0300 gen: 3 serial: <filter>
    speed: 8 GT/s lanes: 16 bus-ID: 08:00.1 chip-ID: 10de:10fa class-ID: 0403
  Device-2: AMD Family 17h HD Audio vendor: ASUSTeK driver: snd_hda_intel
    v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 0a:00.3
    chip-ID: 1022:1457 class-ID: 0403
  Device-3: C-Media Blue Snowball type: USB
    driver: hid-generic,snd-usb-audio,usbhid
  Device-4: Kingston HyperX Cloud Stinger Core Wireless DTS type: USB
    driver: hid-generic,snd-usb-audio,usbhid bus-ID: 3-3.1:5 chip-ID: 0951:176d
    class-ID: 0300 serial: <filter>
  Sound API: ALSA v: k6.1.9-zen1-2-zen running: yes
  Sound Interface: sndio v: N/A running: no
  Sound Server-1: PulseAudio v: 16.1 running: no
  Sound Server-2: PipeWire v: 0.3.65 running: yes
  Device-1: Intel I211 Gigabit Network vendor: ASUSTeK driver: igb v: kernel
    pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: e000 bus-ID: 03:00.0
    chip-ID: 8086:1539 class-ID: 0200
  IF: enp3s0 state: down mac: <filter>
  Device-2: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel pcie: gen: 2
    speed: 5 GT/s lanes: 1 bus-ID: 07:00.0 chip-ID: 8086:2723 class-ID: 0280
  IF: wlp7s0 state: up mac: <filter>
  IF-ID-1: anbox0 state: down mac: <filter>
  IF-ID-2: docker0 state: down mac: <filter>
  IF-ID-3: virbr0 state: down mac: <filter>
  Device-1: Intel AX200 Bluetooth type: USB driver: btusb v: 0.8 bus-ID: 1-7:2
    chip-ID: 8087:0029 class-ID: e001
  Report: bt-adapter ID: hci0 rfk-id: 0 state: up address: <filter>
  Local Storage: total: 3.62 TiB used: 2.52 TiB (69.6%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: Kingston model: SA400S37480G
    size: 447.13 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: J4.3 scheme: GPT
  ID-2: /dev/sdb maj-min: 8:16 vendor: Western Digital
    model: WDS500G2B0A-00SM50 size: 465.76 GiB block-size: physical: 512 B
    logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 30WD
    scheme: GPT
  ID-3: /dev/sdc maj-min: 8:32 type: USB vendor: Samsung model: PSSD T7
    size: 931.51 GiB block-size: physical: 512 B logical: 512 B type: SSD
    serial: <filter> scheme: MBR
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
  ID-4: /dev/sdd maj-min: 8:48 type: USB vendor: Seagate model: Expansion
    size: 1.82 TiB block-size: physical: 4096 B logical: 512 B type: N/A
    serial: <filter> rev: 9300 scheme: MBR
  ID-1: / raw-size: 465.5 GiB size: 465.5 GiB (100.00%)
    used: 426.36 GiB (91.6%) fs: btrfs dev: /dev/sdb2 maj-min: 8:18
  ID-2: /boot/efi raw-size: 260 MiB size: 256 MiB (98.45%)
    used: 29.3 MiB (11.5%) fs: vfat dev: /dev/sdb1 maj-min: 8:17
  ID-3: /home raw-size: 465.5 GiB size: 465.5 GiB (100.00%)
    used: 426.36 GiB (91.6%) fs: btrfs dev: /dev/sdb2 maj-min: 8:18
  ID-4: /var/log raw-size: 465.5 GiB size: 465.5 GiB (100.00%)
    used: 426.36 GiB (91.6%) fs: btrfs dev: /dev/sdb2 maj-min: 8:18
  ID-5: /var/tmp raw-size: 465.5 GiB size: 465.5 GiB (100.00%)
    used: 426.36 GiB (91.6%) fs: btrfs dev: /dev/sdb2 maj-min: 8:18
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: zram size: 31.27 GiB used: 13 MiB (0.0%) priority: 100
    dev: /dev/zram0
  System Temperatures: cpu: 38.0 C mobo: 36.0 C gpu: nvidia temp: 35 C
  Fan Speeds (RPM): cpu: 1679 case-1: 534 case-2: 604 case-3: 0 gpu: nvidia
    fan: 56%
  Power: 12v: 10.19 5v: N/A 3.3v: N/A vbat: 3.23
  Processes: 480 Uptime: 5h 7m wakeups: 0 Memory: 31.27 GiB
  used: 10.01 GiB (32.0%) Init: systemd v: 252 default: graphical
  tool: systemctl Compilers: gcc: 12.2.1 clang: 15.0.7 Packages: 2764 pm: dpkg
  pkgs: 0 pm: nix-default pkgs: 0 pm: nix-sys pkgs: 0 pm: nix-usr pkgs: 45
  libs: 9 pm: pacman pkgs: 2706 libs: 583 tools: pamac,paru,trizen,yay
  pm: flatpak pkgs: 13 Shell: Bash v: 5.1.16 running-in: qterminal
  inxi: 3.3.25
Garuda (2.6.14-1):
  System install date:     2022-04-26
  Last full system update: 2023-02-09 ↻
  Is partially upgraded:   No
  Relevant software:       timeshift NetworkManager mkinitcpio nvidia-dkms
  Windows dual boot:       Probably (Run as root to verify)
  Failed units:            anbox-container-manager.service run-u136.service run-u140.service run-u144.service run-u148.service run-u152.service run-u156.service run-u160.service run-u164.service run-u169.service run-u173.service run-u177.service run-u181.service run-u185.service run-u190.service run-u194.service run-u198.service run-u206.service run-u210.service run-u214.service run-u218.service run-u222.service run-u227.service run-u273.service run-u392.service run-u396.service run-u400.service run-u404.service run-u408.service run-u412.service run-u416.service run-u420.service run-u424.service run-u428.service run-u432.service run-u436.service run-u440.service run-u444.service run-u448.service run-u452.service run-u456.service run-u460.service run-u464.service run-u468.service run-u472.service run-u476.service run-u484.service systemd-networkd-wait-online.service

not sure this is necessary.

Short answser: you don't.
Long answer: you actually can (of course, it's all open source).
But the real question is, do you really want me to spoil the fun for you? :slight_smile:


If you could direct me to the source that's all i'll need

They're called "insults", you can enable/disable them with Defaults insults (this is done for us in /etc/sudoers.d/insults).
They're compiled in, to change them, get the sudo sources, edit and recompile.
Likely, get the sudo-git or sudo-hg AUR package, do what you like, rebuild and install.
makepkg will be your friend. Any arising problems will be yours to keep LOL.
Relevant files in plugins/sudoers/ins_*.
Disclaimer: I never tried, but I think this is the way.
Read and Where are sudo's insults stored? - Ask Ubuntu.
Worth the trouble? I don't know, when I was young I used to edit in ms-dos debug to put all sort of nonsense in the error messages and then spread it on my school computers.

Fun fact: when I'm upset I vent my anger setting questionable passwords (I'm weird, I know).
Once I typed it wrong and it told me "He's not the Messiah, he's a very naughty boy!".


sweet! good to know, thanks!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.