How to connect to Remote Server with (SSH) WinSCP to Google Cloud VM (sFTP)

  1. Open or Install WinSCP : G:\Program Files\winscp\PuTTY\puttygen.exe
  2. click [Generate] (Move the mouse to generate random)
  3. Key Comment: [ENTER YOUR USER: [email protected]]
  4. Key Passphase: GCP Account Pass
  5. Save Public Key: g_pub_key G:\Program Files\winscp\keys
  6. Save Private Key g_pri_key
  7. Copy "Public Key for pasting into OpenSSH authorized_keys file:" [long string]
  8. ssh-rsa BBAAB3NzaC1yc2EAAAADA...zYkyy/V1Lkvs3rh01BQNzbwjUXL4pIlepyL [email protected]
  9. go to CGP to the VM instance:
  10. https://console.cloud.google.com/compute/instances?project=[PROJECT_NAME]
  11. EXAMPLE:
  12. https://console.cloud.google.com/compute/instancesDetail/zones/us-west1-b/instances/[VM_INSTANCE_NAME]?project=[PROJECT_NAME]
  13. Click Edit
  14. Scroll down to SSH Keys
  15. Add SSH KEY click [ADD ITEM]
  16. 1 Save
  17. OPEN WinSCP G:\Program Files\winscp
  18. New Site
  19. Hostname: External Ip
  20. User Name: example [DO NOT ENGER THE @gmail part]
  21. Password: DONT ENTER YET
  22. Click [Advanced]
  23. GO TO SSH > Authentication
  24. Click Private Key File:
  25. Select Private Key from Step 6
  26. Click OK
  27. Click SAVE
  28. Select the newly created site and click on Login button
  29. [searching for host]
  30. * BE SURE TO ENABLE PORT 22 in Firewall Rules
  31. Click Yes
  32. Enter Password when prompted
  33. Done

Video source: o_OQEydt3MI

Good Luck.