vscode for server development

1. Purpose

As the algorithm engineer, trained every day we had a few model parameters g, let alone run multiple models at the same time a. Card ~~~~~~~~~

So, why not these pressures, placing it to the server? But there is a problem, debugging code can only modify server development with vim, very inconvenient.

vscode edit remote connection, a good solution to this problem, remote procedure, local debugging.

2, Configuration

Man of few words said, started:

(1) local download the latest version vscode

(2) Open vscode, extended into the Extensions, mounting Remote Development

 (3) turn on the remote function, ctrl + shift + p, input Remote-SSH: After Settings, and enter the profile settings, settings Remote.SSH: Show Login Terminal to true (checked is true)

(4) a remote configuration, the same ctrl + shift + p, input Remote-SSH: Connect to Host -> Config SSH Hosts -> config pick a remote server profile settings.

 (5) connected to the server, the upper left corner File - "Open Folder, then open the server address is the address.

(6) run the code, you need to find python environment

 Own switching terminal in conda environment for debugging.

(7) After the above is done, every time you log password is required

So, how does the server remember your password? As follows:

a, now local desktop, right-click on the Git Bash Here, enter the following command:

ssh-keygen -t rsa -C "这里任意输入" 

Then all the way to enter, but remember a path:

b, open the path

Copy id_rsa.pub (key pair) in the path

c, the remote server to do the same operation instruction

d, ssh local public key (id_rsa.pub) using xftp copied to the root directory of the remote server

Xshell enter the cat ~ / id_rsa.pub >> ~ / .ssh / authorized_keys

 

We're done! ! !

Published 84 original articles · won praise 149 · views 50000 +

Guess you like

Origin blog.csdn.net/feifeiyechuan/article/details/102905003