Problems with sudoers file and keyboard shortcuts

Hi all,

I have changed the sudoers file to be able to shutdown my system without being asked for a password.

sudo -l shows:

User frankc may run the following commands on frank-laptop-manjaro:
(ALL) NOPASSWD: /usr/bin/shutdown
(ALL) ALL

running sudo /usr/bin/shutdown -r now works - i am not being asked for a password
however - running this through a shortcut does NOT work.

journalctl shows:

sep 02 11:08:35 frank-laptop-manjaro dbus-daemon[578]: [system] Activating via systemd: service name=‘org.freedesktop.home1’ unit=‘dbus-org.freedesktop.home1.service’ requested by ‘:1.75’ (uid=0 pid=2661 comm=“/usr/bin/sudo /usr/bin/shutdown -r now”)
sep 02 11:08:35 frank-laptop-manjaro dbus-daemon[578]: [system] Activation via systemd failed for unit ‘dbus-org.freedesktop.home1.service’: Unit dbus-org.freedesktop.home1.service not found.
sep 02 11:08:35 frank-laptop-manjaro systemd[763]: Started sudo /usr/bin/shutdown -r now.
sep 02 11:08:35 frank-laptop-manjaro kwin_wayland_wrapper[2661]: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sep 02 11:08:35 frank-laptop-manjaro sudo[2661]: pam_unix(sudo:auth): conversation failed
sep 02 11:08:35 frank-laptop-manjaro sudo[2661]: pam_unix(sudo:auth): auth could not identify password for [frankc]
sep 02 11:08:38 frank-laptop-manjaro kwin_wayland_wrapper[2661]: sudo: a password is required

I don’t know what i am missing.

Hoping for some help

Regards Frank

There’s your clue. You cannot use this method from within a GUI because it requires a terminal.

There is however a much easier way. Go into the Plasma System Settings and look here… :arrow_down:

Hi @frank_claessen,

This has been the default for me since I installed Manjaro. I believe it’s a polkit rule:

Hope it helps!

1 Like

Although it used to work in several other distributions, i see your answer as the solution. Thx @Aragorn

1 Like

For one, your post is hard to read. In the future, please format terminal output properly. :wink:

Will do, sorry

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