from pc1 as user1, the shutdown command doesn't cause any problems, but if I try to use it remotely on pc2 as user2 using the ssh protocol, it doesn't work: it requires authentication and then it works.
:~$ /usr/sbin/shutdown -r 0
Failed to schedule shutdown: Interactive authentication required.
~# /usr/sbin/shutdown -r 60
Reboot scheduled for Sat 2024-01-06 11:01:36 CET, use 'shutdown -c' to cancel.
~$ ls -l /usr/sbin/shutdown lrwxrwxrwx 1 root root 14 8 févr. 2023 /usr/sbin/shutdown -> /bin/systemctl
further details:
- from pc1 as user1 this command doesn't need "sudo".
How can I explain this behavior?
from a pc as user
and in ssh ? -shutdown
command needs root / sudo privileges to be executed. If you are not usingsudo
and you are notroot
user, you should have specific privileges elevation like polkit or something.shutdown
issystemctl
in disguise.sudo shutdown
orsudo init 0
sudo poweroff
orsystemctl poweroff
, although a bit brutal.