Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

permission denied when using docker for windows #6

Open
oppianmatt opened this issue Oct 5, 2017 · 2 comments
Open

permission denied when using docker for windows #6

oppianmatt opened this issue Oct 5, 2017 · 2 comments

Comments

@oppianmatt
Copy link

trying to mount in the private key
but get the following error

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @\r\n@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nPermissions 0555 for \'/root/.ssh/id_rsa\' are too open.\r\nIt is required that your private key files are NOT accessible by others.\r\nThis p
rivate key will be ignored.\r\nLoad key "/root/.ssh/id_rsa": bad permissions\r\nPermission denied (publickey).\r\n

docker-compose is using:

volumes:
      - '.:/ansible/playbooks'
      - "./id_rsa:/root/.ssh/id_rsa"

docker for windows

@philm
Copy link
Owner

philm commented Oct 5, 2017

If you install Git for Windows, you can use the git bash shell to change your local key permissions:

chmod 600 ~/.ssh/id_rsa

(Cygwin should work too here)

@heyimalex
Copy link

heyimalex commented May 8, 2018

Hm, I don't think that works; my permissions are set correctly in cygwin and those files still end up being mounted with 0755. I got around it by mounting them to a different folder and changing the entrypoint to a shell script that copies them from the mount to ~/.ssh and then chmods them before running ansible-playbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants