docker-ansible
docker-ansible copied to clipboard
SSH Keys to open
I'm running this on a GitLab pipeline and works like a charm when using cytopia/ansible:latest image. However when I switch to cytopia/ansible:latest-tools I start getting the SSH key to open error.
SSH key is passed as a file via GitLab variables
UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@ WARNING: UNPROTECTED PRIVATE KEY FILE! @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nPermissions 0666 for '/builds/<project-path>/SSH_PRIVATE_KEY' are too open.\r\nIt is required that your private key files are NOT accessible by others.\r\nThis private key will be ignored.\r\nLoad key \"/builds/<project-path>/SSH_PRIVATE_KEY\": bad permissions\r\[email protected]: Permission denied (publickey,password).", "unreachable": true}
I have tried setting 400 permissions on the file but no luck. Even verified but the perms as below.
'
$ chmod -v 400 "${SSH_PRIVATE_KEY}"
mode of '/builds/
$ ls -al "${SSH_PRIVATE_KEY}"
-r-------- 1 root root 2609 Jun 22 05:57 /builds/
NREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@ WARNING: UNPROTECTED PRIVATE KEY FILE! @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nPermissions 0666 for '/builds/
Can you specify how you've started the docker container. Also can you reproduce this locally?
Closing due to inactivity