1

How to configure Ubuntu 18.04 when executing systemctl hibernate password challenge is not required.

$ id -a
uid=1000(user1) gid=1000(user1) groups=1000(coka),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),116(lpadmin),126(sambashare)

Please attached image.enter image description here

Benjamin Loison
  • 190
  • 1
  • 5
user1121055
  • 231
  • 2
  • 15

1 Answers1

1

The easiest way would be to add the proper entry to sudo:

username        ALL=(ALL:ALL) NOPASSWD: /bin/systemctl hibernate
ajgringo619
  • 1,132
  • 1
  • 6
  • 12
  • 1
    Try above. Didn't work. – user1121055 Aug 17 '19 at 12:59
  • `sudo systemctl hibernate` didn't work? I wanted something similar (for suspend), so I made an alias: `alias quit='sudo systemctl suspend'`. – ajgringo619 Aug 17 '19 at 15:02
  • In my case, the reason it did not work was that the tutorial I followed to enable hibernation used `pkexec systemctl hibernate` in the keyboard shortcut. After replacing `pkexec` by `sudo` it worked flawlessly! – Johannes Lemonde Jul 23 '21 at 06:05