DEV Community

Dênis Mendes
Dênis Mendes

Posted on

ERROR FIX: Permissions for '~/.ssh/id_rsa' are too open. Windows and Docker.

Hi there!

If you are getting this error message: Permissions for '~/.ssh/id_rsa' are too open.

Then it may help you.

First things fist, you need to check whether you have wsl 2 activated if not do that:

wsl --list --verbose

Choose in the list which distribution you want to use and version number set as 2:

wsl --set-version <distribution name> <versionNumber>

Like that: wsl --set-version ubuntu 2

Now you need to copy your id_rsa from /mnt/c/Users/username/.ssh/id_rsa to /home/username/.

That done you need to set right permission for that file now:

chmod 400 id_rsa

Go to docker Docker->Settings->Resources->WSL Integration and enable Ubuntu distro.

When you go back to terminal and type docker ps it should work.

At this point we have id_rsa in the right permission setting and docker working at WSL 2 Ubuntu distro. Now you need to update docker-compose.yml which tells id_rsa path using a new path that is: /home/username/id_rsa.

It´s done! Everything should work but anything let me a message in the comments below.

Top comments (0)