Home Assistant - Router Reboot with Ping, EXEC and SSH

I guess so, but you would be better to setup ssh keys, if possible, so you can access without having to include the password in plain text anywhere.