Why does systemctl halt asks for password but systemctl reboot and systemctl poweroff not?
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
2
down vote
favorite
I am using Debian 9.5. From terminal whenever I type the command systemctl halt
, it will say:
Authentication is required to start halt.target
and it will ask for password. But I can use commands systemctl reboot
and systemctl poweroff
and they will not ask for password and will execute successfully.I think if it asks for password for halt then it should also ask for poweroff.
shutdown systemctl
add a comment |Â
up vote
2
down vote
favorite
I am using Debian 9.5. From terminal whenever I type the command systemctl halt
, it will say:
Authentication is required to start halt.target
and it will ask for password. But I can use commands systemctl reboot
and systemctl poweroff
and they will not ask for password and will execute successfully.I think if it asks for password for halt then it should also ask for poweroff.
shutdown systemctl
2
I guess there are polkit actions/policies for the convenience of being able to reboot/poweroff as a normal user (without administrative privileges). halt was probably not considered a command that would be used by "normal" users, so there was no policy added.
â danzel
2 days ago
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I am using Debian 9.5. From terminal whenever I type the command systemctl halt
, it will say:
Authentication is required to start halt.target
and it will ask for password. But I can use commands systemctl reboot
and systemctl poweroff
and they will not ask for password and will execute successfully.I think if it asks for password for halt then it should also ask for poweroff.
shutdown systemctl
I am using Debian 9.5. From terminal whenever I type the command systemctl halt
, it will say:
Authentication is required to start halt.target
and it will ask for password. But I can use commands systemctl reboot
and systemctl poweroff
and they will not ask for password and will execute successfully.I think if it asks for password for halt then it should also ask for poweroff.
shutdown systemctl
edited yesterday
asked 2 days ago
Debian_yadav
8272522
8272522
2
I guess there are polkit actions/policies for the convenience of being able to reboot/poweroff as a normal user (without administrative privileges). halt was probably not considered a command that would be used by "normal" users, so there was no policy added.
â danzel
2 days ago
add a comment |Â
2
I guess there are polkit actions/policies for the convenience of being able to reboot/poweroff as a normal user (without administrative privileges). halt was probably not considered a command that would be used by "normal" users, so there was no policy added.
â danzel
2 days ago
2
2
I guess there are polkit actions/policies for the convenience of being able to reboot/poweroff as a normal user (without administrative privileges). halt was probably not considered a command that would be used by "normal" users, so there was no policy added.
â danzel
2 days ago
I guess there are polkit actions/policies for the convenience of being able to reboot/poweroff as a normal user (without administrative privileges). halt was probably not considered a command that would be used by "normal" users, so there was no policy added.
â danzel
2 days ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
In a later version, systemd v235, halt could be allowed without a password. In order to make it allowed, you would have to edit some polkit configuration file.
The description on the commit which added this feature for halt, says "the whole concept of halting isn't really too useful".[1] I think this point of view explains the difference v.s. poweroff/reboot :-).
Another way to look at it, is that poweroff/reboot buttons are provided in common GUIs, and we expect them to work without needing a password. The systemd project is providing a way to implement this. But the user does not normally want a separate button to "halt".
I reviewed this commit and helped approve it. I felt it was generally safer for systemd not to change this behaviour, and there wasn't a clear reason for change.
The original behaviour might have been considered simpler... maintaining code and documentation for an API if we didn't actually expect it to be used can be positively undesirable. Or it might have been a way to block users from doing something they didn't actually want to do. I'm not sure. I very vaguely imagined one other concern. "halt" is defined to enter the ROM Monitor, if there is one. If there was some hypothetical ROM Monitor which required a password at boot time, I am not certain that it would prompt for the password again when the OS handed back control.
Adding polkit support in v235 was a side-benefit of making logind support halt. This was implemented to make systemctl
behave consistently for halt, but the polkit support wasn't really the reason.
[1] PR #6944 - "systemctl reboot/suspend tweaks" - commit 36b69c313120 - "logind: add Halt() and CanHalt() APIs"
Link: https://github.com/systemd/systemd/pull/6944/commits/36b69c31312007f522a2a7ae5087ae90bd7867cc
polkit hints
You can see the polkit default settings in /usr/share/polkit-1/actions/org.freedesktop.login1.policy
. You can search for similar entries for power-off
and reboot
, and look at their <defaults>
element. And in v235 and above, there will be an entry for halt
which you can compare.
You may notice some additional details. Like, if you have logged in over the network, the system will require an admin password to power off.
If you know the right incantation, you can create a file somewhere under /etc/polkit-1
which provides a different setting from the default. My guess is you have to define a "rule".
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
In a later version, systemd v235, halt could be allowed without a password. In order to make it allowed, you would have to edit some polkit configuration file.
The description on the commit which added this feature for halt, says "the whole concept of halting isn't really too useful".[1] I think this point of view explains the difference v.s. poweroff/reboot :-).
Another way to look at it, is that poweroff/reboot buttons are provided in common GUIs, and we expect them to work without needing a password. The systemd project is providing a way to implement this. But the user does not normally want a separate button to "halt".
I reviewed this commit and helped approve it. I felt it was generally safer for systemd not to change this behaviour, and there wasn't a clear reason for change.
The original behaviour might have been considered simpler... maintaining code and documentation for an API if we didn't actually expect it to be used can be positively undesirable. Or it might have been a way to block users from doing something they didn't actually want to do. I'm not sure. I very vaguely imagined one other concern. "halt" is defined to enter the ROM Monitor, if there is one. If there was some hypothetical ROM Monitor which required a password at boot time, I am not certain that it would prompt for the password again when the OS handed back control.
Adding polkit support in v235 was a side-benefit of making logind support halt. This was implemented to make systemctl
behave consistently for halt, but the polkit support wasn't really the reason.
[1] PR #6944 - "systemctl reboot/suspend tweaks" - commit 36b69c313120 - "logind: add Halt() and CanHalt() APIs"
Link: https://github.com/systemd/systemd/pull/6944/commits/36b69c31312007f522a2a7ae5087ae90bd7867cc
polkit hints
You can see the polkit default settings in /usr/share/polkit-1/actions/org.freedesktop.login1.policy
. You can search for similar entries for power-off
and reboot
, and look at their <defaults>
element. And in v235 and above, there will be an entry for halt
which you can compare.
You may notice some additional details. Like, if you have logged in over the network, the system will require an admin password to power off.
If you know the right incantation, you can create a file somewhere under /etc/polkit-1
which provides a different setting from the default. My guess is you have to define a "rule".
add a comment |Â
up vote
2
down vote
accepted
In a later version, systemd v235, halt could be allowed without a password. In order to make it allowed, you would have to edit some polkit configuration file.
The description on the commit which added this feature for halt, says "the whole concept of halting isn't really too useful".[1] I think this point of view explains the difference v.s. poweroff/reboot :-).
Another way to look at it, is that poweroff/reboot buttons are provided in common GUIs, and we expect them to work without needing a password. The systemd project is providing a way to implement this. But the user does not normally want a separate button to "halt".
I reviewed this commit and helped approve it. I felt it was generally safer for systemd not to change this behaviour, and there wasn't a clear reason for change.
The original behaviour might have been considered simpler... maintaining code and documentation for an API if we didn't actually expect it to be used can be positively undesirable. Or it might have been a way to block users from doing something they didn't actually want to do. I'm not sure. I very vaguely imagined one other concern. "halt" is defined to enter the ROM Monitor, if there is one. If there was some hypothetical ROM Monitor which required a password at boot time, I am not certain that it would prompt for the password again when the OS handed back control.
Adding polkit support in v235 was a side-benefit of making logind support halt. This was implemented to make systemctl
behave consistently for halt, but the polkit support wasn't really the reason.
[1] PR #6944 - "systemctl reboot/suspend tweaks" - commit 36b69c313120 - "logind: add Halt() and CanHalt() APIs"
Link: https://github.com/systemd/systemd/pull/6944/commits/36b69c31312007f522a2a7ae5087ae90bd7867cc
polkit hints
You can see the polkit default settings in /usr/share/polkit-1/actions/org.freedesktop.login1.policy
. You can search for similar entries for power-off
and reboot
, and look at their <defaults>
element. And in v235 and above, there will be an entry for halt
which you can compare.
You may notice some additional details. Like, if you have logged in over the network, the system will require an admin password to power off.
If you know the right incantation, you can create a file somewhere under /etc/polkit-1
which provides a different setting from the default. My guess is you have to define a "rule".
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
In a later version, systemd v235, halt could be allowed without a password. In order to make it allowed, you would have to edit some polkit configuration file.
The description on the commit which added this feature for halt, says "the whole concept of halting isn't really too useful".[1] I think this point of view explains the difference v.s. poweroff/reboot :-).
Another way to look at it, is that poweroff/reboot buttons are provided in common GUIs, and we expect them to work without needing a password. The systemd project is providing a way to implement this. But the user does not normally want a separate button to "halt".
I reviewed this commit and helped approve it. I felt it was generally safer for systemd not to change this behaviour, and there wasn't a clear reason for change.
The original behaviour might have been considered simpler... maintaining code and documentation for an API if we didn't actually expect it to be used can be positively undesirable. Or it might have been a way to block users from doing something they didn't actually want to do. I'm not sure. I very vaguely imagined one other concern. "halt" is defined to enter the ROM Monitor, if there is one. If there was some hypothetical ROM Monitor which required a password at boot time, I am not certain that it would prompt for the password again when the OS handed back control.
Adding polkit support in v235 was a side-benefit of making logind support halt. This was implemented to make systemctl
behave consistently for halt, but the polkit support wasn't really the reason.
[1] PR #6944 - "systemctl reboot/suspend tweaks" - commit 36b69c313120 - "logind: add Halt() and CanHalt() APIs"
Link: https://github.com/systemd/systemd/pull/6944/commits/36b69c31312007f522a2a7ae5087ae90bd7867cc
polkit hints
You can see the polkit default settings in /usr/share/polkit-1/actions/org.freedesktop.login1.policy
. You can search for similar entries for power-off
and reboot
, and look at their <defaults>
element. And in v235 and above, there will be an entry for halt
which you can compare.
You may notice some additional details. Like, if you have logged in over the network, the system will require an admin password to power off.
If you know the right incantation, you can create a file somewhere under /etc/polkit-1
which provides a different setting from the default. My guess is you have to define a "rule".
In a later version, systemd v235, halt could be allowed without a password. In order to make it allowed, you would have to edit some polkit configuration file.
The description on the commit which added this feature for halt, says "the whole concept of halting isn't really too useful".[1] I think this point of view explains the difference v.s. poweroff/reboot :-).
Another way to look at it, is that poweroff/reboot buttons are provided in common GUIs, and we expect them to work without needing a password. The systemd project is providing a way to implement this. But the user does not normally want a separate button to "halt".
I reviewed this commit and helped approve it. I felt it was generally safer for systemd not to change this behaviour, and there wasn't a clear reason for change.
The original behaviour might have been considered simpler... maintaining code and documentation for an API if we didn't actually expect it to be used can be positively undesirable. Or it might have been a way to block users from doing something they didn't actually want to do. I'm not sure. I very vaguely imagined one other concern. "halt" is defined to enter the ROM Monitor, if there is one. If there was some hypothetical ROM Monitor which required a password at boot time, I am not certain that it would prompt for the password again when the OS handed back control.
Adding polkit support in v235 was a side-benefit of making logind support halt. This was implemented to make systemctl
behave consistently for halt, but the polkit support wasn't really the reason.
[1] PR #6944 - "systemctl reboot/suspend tweaks" - commit 36b69c313120 - "logind: add Halt() and CanHalt() APIs"
Link: https://github.com/systemd/systemd/pull/6944/commits/36b69c31312007f522a2a7ae5087ae90bd7867cc
polkit hints
You can see the polkit default settings in /usr/share/polkit-1/actions/org.freedesktop.login1.policy
. You can search for similar entries for power-off
and reboot
, and look at their <defaults>
element. And in v235 and above, there will be an entry for halt
which you can compare.
You may notice some additional details. Like, if you have logged in over the network, the system will require an admin password to power off.
If you know the right incantation, you can create a file somewhere under /etc/polkit-1
which provides a different setting from the default. My guess is you have to define a "rule".
edited 2 days ago
answered 2 days ago
sourcejedi
18k22375
18k22375
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f460481%2fwhy-does-systemctl-halt-asks-for-password-but-systemctl-reboot-and-systemctl-pow%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2
I guess there are polkit actions/policies for the convenience of being able to reboot/poweroff as a normal user (without administrative privileges). halt was probably not considered a command that would be used by "normal" users, so there was no policy added.
â danzel
2 days ago