Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I've already setup the ssh key, but VSCode keeps asking for password

I'm using a macbook(MacOS) to connect to a remote Ubuntu server. I copied the public ssh key to the server using ssh-copy-id and checked that the ssh key works on the terminal. When I do ssh [email protected], connection is made without asking for password). However, when I try to connect to the server through Visual Studio Code, VSCode keeps asking for password. Is there a way to fix this?

Thanks in advance!

like image 317
sukrama Avatar asked Sep 01 '20 15:09

sukrama


1 Answers

It was a problem with the config file.
The VSCode needs the "absolute" path.

In case of MacOS, ssh-copy-id seems to only copy the absolute path relative to the user.
In other words, it omits "/Users/username" before "/.ssh".

Adding "/Users/username" in the IdentityFile attribute in .ssh/config solved the problem.

like image 161
sukrama Avatar answered Oct 15 '22 12:10

sukrama