2

Private key is mounted using volume in docker container. Permissions on the host system (Windows) are defined as -r--r--r--. But when i run compose file get this error "Permissions 0755 for '/root/.ssh/id_rsa' are too open."

I also tried to change permissions using bash script that uploads the file to SFTP server.

chmod 600 /root/.ssh/id_rsa

Error:

 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
| @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
| @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
| Permissions 0755 for '/root/.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.
| Load key "/root/.ssh/id_rsa": bad permissions
| Permission denied (publickey,password).
| --- ERROR: sftp failed (status 255) ---

1 Answer 1

3

Your problem seems close to this one. In this case, your chmod 600 should be failing silently, which explains the error, the file remaining "world readable". The OP's conclusion on the previous link is the following for permissions problems : for now, prefer running Linux containers in a GNU/Linux VM on a Windows host rather than directly running them through Docker Desktop for Windows.

If you check out the documentation itself, this issue and its origin (the way Docker for Desktop currently works with volumes for Linux containers, through SMB) are already known.

You should still use it to run Windows based containers, though.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .