0

I have been able to set up SSH access to my Google Cloud Platform VM via SFTP using WinSCP, but I now wish to do the same using another VM.

I have tried the ssh-keygen -t rsa , ssh-copy-id demo@198.51.100.0 method but always come up against the "Permission denied (public key)" error which from researching seems to be a pretty widespread issue with few reliable fixes (all the ones I tried didn't work).

I used PuttyGen to create the public and private key, and inserted the public key onto the server just through GCP settings, adding it under the SSH settings for my instance.

I am just confused on what to do with the private key when simply trying to sftp through the terminal on a separate VM, as before I would load the private key into WinSCP settings. Is there a folder I need to place it in or?

chivs890
  • 27
  • 4
  • 1
    Welcome to Stack Overflow! Please move your question to [su] (delete here, re-post there). It's [off-topic here](//stackoverflow.com/help/on-topic). – Martin Prikryl Aug 21 '18 at 12:33

2 Answers2

0

Regarding your first issue of "Permission denied (public key)" error, please follow the troubleshooting in this link and this.

About your other question of "what to do with the private key when simply trying to sftp through the terminal", that depends on the settings of the specific the 3rd party SFTP tool you are using. To locate the locations of SSH key after generating them, please review this document.

-1

Once you have added the public key in the VM, you would need to boot the VM for public key to take effect. Try rebooting it and try