bobokun Posted March 3, 2018 Share Posted March 3, 2018 I'm trying to setup passwordless ssh access inside a docker container to another one of my servers in order to send commands through ssh. I have it working but whenever I update the docker container it rebuilds it and I lose the SSH key that is under /root/.ssh/id_rsa Is there anyway to store the private key id_rsa in one of the config directory of the docker container and copy that into /root/.ssh/ upon build time so every time it updates I won't lose the key? Thanks! Quote Link to comment
bobokun Posted March 3, 2018 Author Share Posted March 3, 2018 I'm trying to do this for the home-assistant container. Also is there any way to allow docker containers to see deployed ip addresses of other docker containers? For example I'm trying to access another docker container pihole through the command curl -X GET 'http://192.168.1.xx/admin/api.php?status' in order to get some information but I just keep getting the error curl: (7) Failed to connect to 192.168.1.xx port 80: No route to host Is it because home assistant docker is set to host but the pihole has a changed ip address so the network type is br0? When I type the same command through another computer I see the results fine it's just within the docker container it's being restricted access to not being able to see pihole Quote Link to comment
CHBMB Posted March 3, 2018 Share Posted March 3, 2018 A container on br0 can't communicate with one that has a dedicated ip. Limitation of docker networking. As for the SSH key add another path to the container /mnt/cache/appdata/home-assistant/ssh/id_rsa and map it to /.ssh/id_rsa 1 Quote Link to comment
bobokun Posted March 3, 2018 Author Share Posted March 3, 2018 Thank you! I got it working Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.