Usually users are allowed to use ssh. Let me do a little guessing…the private key is in the .ssh folder of user ‘Pi’? There is no password set for the keys? ‘user@host’ is allowed to use sudo on ‘host’ without password?
You can login into the remote host, so it seems that the permissions are right. Are you launching Home Assistant as pi?
No password protection of your private key. It could be if you use ssh directly from the commandline that a tool like ssh-askpass is providing your password.
Ha, I got it work
Thing is, root account was not enabled on Raspbian.
Adding “PermitRootLogin yes” into “/etc/ssh/sshd_config” and set a password for root user does the trick.
Thanks @fabaff for the hint.
My hass on raspbian is running as root. I have also enabled the ssh without password. When I putty to raspbian, running the command manually works, but not through HASS switch.
I have also tried using sudo.
My raspbian root user is active and has current password. Also permitted root login. My switch ON command using wakeonlan works perfectly, not the ssh
I have a WOL switch for switching on my NAS and a ssh switch for switching it off. Is there any easy way of combining the two? so that I can get the sate from the WOL AND also switching on and the switching off from command line?
Hi folks,
Apologies, I know this is an old thread…
I’m having trouble with this myself. I’m unclear as to the actual resolution reading through this.
I’m running HA in a Linux Docker (HASSIO).
I’m just wanting to shutdown Octoprint on an RPi.
The switch config is:
No scripts or anything fancy with my setup.
When I try and execute from LoveLace it fails (via a simple entity switch).
I can SSH into the HA docker and manually run the command okay. It works this way. I am however logging in as root when done manually. Not as the HA user.
I’ve gone looking for a HA user - can’t find anything that might be… I’ve issued the following command to look:
I am trying to log in as ‘pi’ anyway?
I’ve enabled password-less access into the Pi by setting up key pairs. Works when I manually log via the HA CLI.
I’m sure I’m close but doing something stupid…
Help!