I can’t shutdown my Synology from Hassio GUI (HA 0.89.1).
My shell_command is: turn_off_nas: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /root/.ssh/id_rsa [email protected] '/sbin/shutdown -h now'
The command works fine in Terminal (SSH access without password on Synology NAS), but not from the switch.
I get this error:
The problem is with Hassio you don’t get access to a lot of functions outside the container… hassbian doesn’t care as it’s a full Linux district with full Linux… hass.io just doesn’t give you this…
The other week I was trying to run a bash script to delete email from my Gmail - couldn’t do it. I then found a Python script and it works… Maybe look on Google and see if you can find an alternate script that does the same thing…
Error executing script: __import__ not found
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/python_script/__init__.py", line 166, in execute
exec(compiled.code, restricted_globals, local)
File "nas_shutdown.py", line 1, in <module>
ImportError: __import__ not found
Can you give us more information? I tried to follow the guide that you reference
Problem for me is that i not able to connect SSH over port 22222 to the RaspberryPI host.
I follow the procedure to import the authorized_keys via USB but all the time i get the same problem
For me that´s means that the Raspeberry host not allow SSH conection over this port!
I just spend hours to implement but no clear information or idea about what is the missing point here…
Make sure the SSH service is enabled on your NAS
Control Panel > Terminal & SNMP > Terminal > Enable SSH
Make sure the user you use has admin role
On HA side:
First of all try just a normal SSH session to the NAS from your HA shell.
Most probably you will first be prompted to accept the NAS as a valid host (security fingerprint)
After this fingerprint acceptation the sshpass command should work fine