You are not logged in.
Pages: 1
Hey Guys.
Is it possible to remotely shutdown or suspend a server(pc name is serv) via systemd?
I found with -H one can execute systemd tasks remotely. I tried to suspend the remote system with:
systemctl -H alarm@serv suspend -ibut the response is:
Failed to set wall message, ignoring: Interactive authentication required.
Failed to suspend system via logind: Interactive authentication required.
Failed to start suspend.target: Interactive authentication required.
See system logs and 'systemctl status suspend.target' for details.I added the user alarm on the remote machine and added a ssh key. I made sure it can login with:
ssh alarm@serv On the server the user alarm is in the power group. I also added the following line to sudoers file:
alarm ALL=NOPASSWD:/usr/bin/systemctl suspendI also tried to skipp the wall warning by adding --no-wall to the remote command but with no effect. It seems that systemd only allows to execute suspend if the user is logged in locally but I cant find any way around it.
Offline
Is it possible to remotely shutdown or suspend a server(pc name is serv) via systemd?
ssh into it and issue sudo systemctl suspend
Offline
Pages: 1