Better error message for "interactive authentication required"
https://github.com/systemd/systemd/blob/564c44436cf64adc7a9eff8c17f386899194a893/src/shared/bus-util.c#L454 - the error message returned here is very ambiguous and unhelpful when it is bubbled up to userland. The error returned should be more descriptive, and should probably mention something about elevated privileges being required.
Example:
core@ip-10-0-10-70 ~ $ systemctl stop datadog
Failed to stop datadog.service: Interactive authentication required.
Instead of telling me anything that would help me remedy the issue, I'm left baffled as to why this command didn't run. Granted, all I need to do is re-run with sudo, but there should be some sort of indication that elevated privileges are required.
This also had me puzzled until Google led me to this Github issue.
Also encountered when I tried to remotely shutdown a machine on my network:
smop@local:~$ systemctl --host remote poweroff
smop@local's password:
Failed to set wall message, ignoring: Interactive authentication required.
Failed to power off system via logind: Interactive authentication required.
Failed to start poweroff.target: Interactive authentication required.
See system logs and 'systemctl status poweroff.target' for details.
Yeah, I tried to restart remote services, but shit happened. Could you add 'sudo' option ? for running restart with sudo privileges if user has them?
yes, it pulluzed me .
We have not forgotten
Agreed, it is needed
this error message is confusing.