๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ“

Let's connect Google cloud VM and Pycharm

Let's connect GCP VM to Pycharm in your local with SSH key pair.

I've only checked the connection to the Google cloud server, but this seems to apply to other Remote Servers as well.


Let's start with the assumption that you have saved the SSH key locally and registered it on the Remote Server you want to connect to.

*  and you need Pycharm pro version *




1. Open the project you want to connect to the Remote Server as Pycharm.


2. When connecting to Remote Server for the first time, make sure go to 'Tools> Deployment> Configuration' in the top menu. And click 'Add Server' ('Green +' button in Deployment window)


SFTP is an abbreviation for 'Secure FTP' and uses 22 ports.


3. Enter the required information for the connection.

SFTP host: external IP of VM instant (Click 'Test' for checking connection)

Port: 22

Rootpath: Click 'Autodetech'

Username: Username of Google cloud server(Remote Server)

Auth type: Click 'key pair'

Private key file : SSH key file

Key passphrase : If you registered your passphrase when you created the SSH key, enter it.


4. 
Go to Mapping in the top menu in the Deployment window and set Deployment path(it's a directory path) on server (remote).


5. Then upload the files to the Remote Server.


Now, you can run the Python file on the Remote Server in Pycharm.