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 username@x.x.x.x
, 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!
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.