AlexxIT / SSHCommand

Run any SSH command on remote server from Home Assistant service call
https://github.com/AlexxIT/Blog
MIT License
93 stars 8 forks source link

Login as other user and then elevate as root #26

Open andremain opened 4 months ago

andremain commented 4 months ago

I am trying to login to my synology using my user and then elevate to root and then run a command using a home assistant script.

This is what i have so far:

service: ssh_command.exec_command
data:
  host: 10.10.10.245
  port: 22
  user: andremain
  pass: password
  command: ssh -p password root@10.10.10.254 -i sudo synonet --wake "54:04:a6:28:d4:fa" eth0

Please help!

AlexxIT commented 4 months ago

I don't know how to help

sigmaenigma commented 2 months ago

I am trying to login to my synology using my user and then elevate to root and then run a command using a home assistant script.

This is what i have so far:

service: ssh_command.exec_command
data:
  host: 10.10.10.245
  port: 22
  user: andremain
  pass: password
  command: ssh -p password root@10.10.10.254 -i sudo synonet --wake "54:04:a6:28:d4:fa" eth0

Please help!

Do you have SSH enabled on the Synology server? You might also try the Synology integration in HomeAssistant but I think you're trying to do a "Wake on Lan" argument.