Hello,
I have read and researched the various post on this forum related to that topic without much success.
My scenario: I have a server PC on Proxmox running two VMs: Ubuntu server and HA. I also have a NAS which is mounted on the Ubuntu where I run Plex reading media files on the NAS via the mount. I noticed constant CPU load on the NAS so I wanted a button in HA where I can mount only when I am going to use Plex or else unmount it.
working linux command:
Mounting: sudo mount -a
Unmounting: sudo umount -a -t cifs -l
Steps followed:
-
Install SSH & Web Terminal Addon
-
generated keygen
ssh-keygen -t rsa -b 4096
-
copying keys for ubuntu server
ssh-copy-id [email protected]
-
copying keys to config folder to avoid override during HA update
cp /root/.ssh/id_rsa /config
-
Created the HA button:
- platform: command_line
switches:
mount_media_nas:
command_on: "ssh -i /config/ssh_keys/ubntsrv -o 'StrictHostKeyChecking=no' [email protected] sudo mount -a'"
command_off: "ssh -i /config/ssh_keys/ubntsrv -o 'StrictHostKeyChecking=no' [email protected] sudo umount -a -t cifs -l'"
I get the following error:
Logger: homeassistant.components.command_line.switch
Source: components/command_line/switch.py:109
Integration: command_line (documentation, issues)
First occurred: 11:04:00 AM (1 occurrences)
Last logged: 11:04:00 AM
Command failed: ssh -i /config/ssh_keys/ubntsrv -o 'StrictHostKeyChecking=no' [email protected] sudo mount -a'
My conclusion is the ssh keys are not being found in the right place? Any help please.