I use boot2docker on Windows 7. VirtualBox mounts my Windows ~ / .ssh directory from Windows ( c:\Users\Me\.ssh ) inside the boot2docker virtual machine ( /c/Users/Me/.ssh ).
My Dockerfile sets up the image to be used as a development environment. It copies the set of SSH keys and configuration that are used for automatic deployment to the container. It works great. When the container starts, it automatically clones the git repository inside the image without prompting.
Now I'm trying to use the same image, but I allow the user to mount via docker run -v ... their own .ssh directory so that they can use their own SSH keys instead. When I do this, adding a command to start the container in -v /home/myself/.ssh:/home/guest/.ssh I get an SSH warning that the permissions are too open:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0777 for '/home/guest/.ssh/id_rsa' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. bad permissions: ignore key: /home/guest/.ssh/id_rsa
I tried adding a line to chmod -R 700 /home/guest/.ssh in the ENTRYPOINT script, but it turned out to be either inefficient or executed before the volume is installed.
I also tried changing the permissions of /home/guest/.ssh from the working container and was unable to do this. I do not get errors when running chmod -R 700 /home/guest/.ssh , but the permissions do not change.
I saw in another Docker volume resolution question the assumption that the questionnaire uses an ACL, but I did not know if this was a good idea, or if it would even work.
Regardless of what is the easiest way to let the user use their own SSH keys and SSH configuration inside the Docker container?
source share