I’ve got it working completely now but just a note on some modifications to your instructions…
When I tried to copy over the keys to the host I got a “permission denied” error.
looking into that error I realized that since I already had an authorized_keys file for logging in from putty it wouldn’t allow be to copy the key over with your command.
I had to manually edit my authorized_keys file and append the public key content to that file.
It all works now. I can use portainer to console into the container and then ssh back into the host.
I’ll have to try some shell_commands from HA to make sure that it all completely works tho.
Using a Synology to run the HASS docker container,
However now I’m stuck at the point where if I ssh from the docker container using ssh -p 'port' '[email protected]' I get a prompt asking me for my password…
Additionally, it seems that visudo doesn’t exist on the synology distro, is there any manual way to do what visudo does ?
How should I get to solving the first issue ?
I do see the signature was added to the host machine successfully
root@BENITA-NAS:~/.ssh# ssh-copy-id my_user@my_ip -p my_port
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already
installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
my_user@my_ips's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh -p 'port' 'user@my_ip'"
and check to make sure that only the key(s) you wanted were added.
so i guess next is to confirm that the key content is indeed in the host home directory for your user.
so if you ssh directly into your synology and cd .ssh
you should have an authorized_keys file
the key in id_rsa must match one of the entries in authorized keys
Yes, it’s there alright and the content of the key on the host authorized_keys matches the id_rsa.pub file’s content
Something I’m not sure about - should the mount be according to the user I intend on using, meaning :
Instead of /root/.ssh should I use /my_user/.ssh as the container mount target ?
Could it be somehow related to user rights ?
Correct, but in your instructions you said something like: /volume1/Media/SmartHome/Config/HomeAssistant/.sshkeys:/root/.ssh
In the case I’m using a user which login isn’t root, let’s say ohadbenita, shouldn’t the mount look like this :/volume1/Media/SmartHome/Config/HomeAssistant/.sshkeys:/ohadbenita/.ssh
No luck, it claims this is a directory, not to mislead so I’ll repeat this again - I was unable to run visudo on the host machine, could that be what’s causing this ?