I am working with an embedded system and would like to initiate a reboot from a remote machine.
I have tried various methods, including
ssh -o StrictHostKeyChecking=no root@${HOST} /bin/systemctl reboot -i
but nothing has really worked, the above gives me the following feedback:
Failed to set wall message, ignoring: Interactive authentication required.
Failed to reboot system via logind: Interactive authentication required.
Failed to start reboot.target: Interactive authentication required.
ee system logs and 'systemctl status reboot.target' for details.
and systemctl status reboot.target gives me:
● reboot.target - Reboot
Loaded: loaded (/lib/systemd/system/reboot.target; enabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:systemd.special(7)
I found that many people have been able to resolve similarreboot issues by prepending sudo to the reboot command but since I'm logging in as root already, that should not be needed. I am aware about the security implications that logging in with root has but please inore that for now. I would like to focus at the task at hand: How can I trigger a reboot by logging in with root over ssh?
What I've already tried includes:
ssh -o StrictHostKeyChecking=no root@${HOST} rebootssh -o StrictHostKeyChecking=no root@${HOST} /sbin/rebootssh -o StrictHostKeyChecking=no root@${HOST} /bin/systemctl reboot -i
The remote box runs a custom embedded Linux distribution built with Yocto
Interactive authentication required– I haven't tested, but what if you usessh -t …to give the remotesystemctla tty so it's able to interactively ask you the root's password and fulfill the requirement?sudo rebootwork?init 6a shot aswellinit 6, I did:ssh -o StrictHostKeyChecking=no root@${HOST} /sbin/telinit 6