I want to get info from my nas using ssh on my nas.
Ive got hassio running on a Raspberry Pi.
So i want to logon to my Synology Nas that is running in the same network to get the public ip to check if the VPN on my nas is still working. (Ifconfig | grep tun0)
And want to use the result to send a push message.
I’m new to hassio and spend a while searching this forum, but only find things about ssh on the hassio server.
I think the shell_command integration can only be used to do something on the OS where Hassio is installed on.
I want to get information from another server. So I need to configure somewhere an IP, Username, Password, the command to execute, or something.
cq create a sensor on that gets information from another network nas using ssh.
Theree are ways which you can execute remote commands, but they are beyond my level of skill… mostly it has to do with authentication on the remote machine…
Thanks, i’ve done some research, and i think i got it.
I should be able to run a ssh comnand on the host that runs a ssh command on the remote. And indeed, the challenge is the authentication between the host and remote.
But this does not work.
It works fine on the ssh commandline of my hassio installation (putty and login as root).
The location of the id_rsa file is based on the creation of the ssh keys etc. I used the webpage “http://www.linuxproblem.org/art_9.html” to logon to my nas without a password.
Put your id_rsa file inside a directory in the /config directory.
When you SSH in, you are inside another container, and not in Home Assistant container. So running the command from there will work, but when you tell Home Assistant to run the command it’s running inside the Home Assistant container.
Where is the /config directory?
I get a permission denied error when trying to execute a command. What did you do with permissions of the sshnas folder?
How did you get the login without password working? I assume you setup keys? No matter what I try with keys, I get ‘connection refused’. I can login fine if I don’t use keys and just use a password (which I know you shouldn’t do). Any thoughts?