🍑

Solution of Could not establish connection to "IP": Permission denied

2024/06/24に公開

1. Got the permission error.

I got this error in VSCode: "Could not establish connection to "XXX.XX.XX.XX": Permission denied (publickey)."

The solution is there(on directory that has .pem):

chmod 400 yourkey.pem

This solution from here. So helpful.

2. Supplement: How to connect VPS

Select the Connect to host... and Add new SSH Host... command palette of VSCode(Need ssh remote extension)

ssh -i "/Users/usename/.ssh/yourkey.pem" root@XXX.XX.XX.XX

Then, reselect Connect to host... and choice IP you set.

Discussion