1

I am attempting to install and access vscode in an instance of Compute Engine of GCP using the instructions on Coder.1

I have also been going through their instructions on exposing code-server using SSH2, however, when I try and run the command ssh -N -L 8080:127.0.0.1:8080 [user]@<instance-ip> swapping out [user] and ip address, I get the following:

The authenticity of host 'ip address (ip address)' can't be established.
ECDSA key fingerprint is SHA256:"hash".
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ipaddress' (ECDSA) to the list of known hosts.
[user]@<instance-ip>: Permission denied (publickey).

Code server should be running as when trying to execute I get:

info  code-server 4.9.1
info  Using user-data-dir ~/.local/share/code-server
error listen EADDRINUSE: address already in use 127.0.0.1:8080

Attempting to login using http:\\127.0.0.1:80 on Firefox making sure Don’t enable HTTPS-Only Mode is on, page cannot be found.

Admittedly, I have little experience with Linux and SSH.

Any way I can troubleshoot this?

apk19
  • 47
  • 6

1 Answers1

1

Permission denied: states that you are not authorized to use SSH to access the remote server. You should make sure that the private key for your SSH keychain has been added to your SSH keychain and that the SSH public key for your user account has been uploaded to the server in order to resolve this issue. When running the ssh command, you can also try specifying the path to your private key file by using the -i flag. For instance:

ssh -i /path/to/private_key [user]@<instance-ip>

ssh -i /path/to/private_key -N -L 8080:127.0.0.1:8080 [user]@instance-ip> 

If the private key file is protected by a passphrase, you will also need to provide the correct passphrase and the -p flag.

Attaching a troubleshooting doc for reference.

Sai Chandra Gadde
  • 2,242
  • 1
  • 3
  • 15
  • Thanks for the quick response, but I still get the same error. When it try your code I get a Warning: Identity file /path/to/private_key not accessible: No such file or directory. It is strange as I have been able to SSH into the VM through vscode on my machine adding the ssh keys through the console. – apk19 Jan 28 '23 at 05:02
  • If you were able to SSH into the VM using VSCode, then it sounds like the problem you're having is related to the private key's path. Check to see that the path is correct and that you have the appropriate access rights to the file. In addition, if the private key is not in the same directory as the command, you may need to specify its full path. – Sai Chandra Gadde Jan 28 '23 at 05:07