DEV Community

Dênis Mendes
Dênis Mendes

Posted on

1

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.

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay