Command line switch: SSH to raspberry not working

Hi
I’m trying out hass.io and like the idea pretty much :slight_smile:

I’m using some command line switches to control remotely Raspberry GPIO’s.
Command looks like ssh [email protected] sudo /home/pi/raspberry-remote/./send 00001 1 1
SSH login without password is enabled.
The switch works in my productive Home Assistant environment well.

Yet using the switch in hass.io does not work :frowning:

2017-05-16 11:33:46 ERROR (<concurrent.futures.thread.ThreadPoolExecutor object at 0x7f3fe4264e80>_7) [homeassistant.components.switch.command_line] Command failed: ssh [email protected] sudo /home/pi/raspberry-remote/./send 00001 1 1
2017-05-16 11:33:47 ERROR (<concurrent.futures.thread.ThreadPoolExecutor object at 0x7f3fe4264e80>_8) [homeassistant.components.switch.command_line] Command failed: ssh [email protected] sudo /home/pi/raspberry-remote/./send 00001 1 0

How might I solve this?
Thanks

Don’t you need the remote command in quotes?

ssh [email protected] 'sudo /home/pi/raspberry-remote/./send 00001 1 1'

There is no sudo with hass.io

On hass docker you have no private key install on ~/.ssh. I think you need copy this into config folder and set that with commando line: https://www.cyberciti.biz/faq/force-ssh-client-to-use-given-private-key-identity-file/

Thanks for your answers.

None of the tips did work for me.
It’s, as Dale mentioned, not possible to do sudo from hass.io.
Since I’m just an end user with very limited Linux knowledge, I decided to switch back to my standard homeassistant.

Happy to try hass.io out again later when it might be easier to use for me…

Oh, You first command is okay. I will add a ssh client to homeassistant docker. Try it agen with next homeassistant 0.45 relase. https://github.com/home-assistant/hassio-build/commit/26bb3d4145d1dd0894b078120989fce3325e4a9c

EDIT / Sidenote:
With a raspberry pi without password, you have a very high security hole inside your Network. Use private/public key login instead no password to aware that you not work for a botnet.

1 Like

Should now work inside 0.45

1 Like

Unfortunately not for me with 0.46.
Same behaviour like before :frowning:

you should be using ssh [email protected] to get into your raspberry pi.

You can modify the “configuration.yaml” by Smaba, then SSH into hassio “ssh root @ip: 8123” and then execute the command “hassio homeassistant restart” to restart the Home Assistant server.

2 Likes

Hello @pvizeli

Can you help me ?

I will wish to obtain the temperature from another raspberry.

Copy to clipboard

    - platform: command_line
      name: Température_Raspberry
      scan_interval: 300
      command: ssh -i /config/.ssh/id_rsa -o StrictHostKeyChecking=no -q [email protected] sensors
      unit_of_measurement: '°C'

Not working
However in the terminal on my HA :
ssh -i /config/.ssh/id_rsa -o StrictHostKeyChecking=no -q [email protected] sensors
works !

Best regards

It’s been three years since the last post.
Maybe try glances instead: