2019 VS Code Remote Development configuration (warming up)

Statement 1: I Caishuxueqian, with Guo Degang words, "I was a schoolboy," if wrong, welcomed the discussion, do not abuse ^ _ ^.
Statement 2: Keep the original blog when reproduced the original link or add my blog address at the beginning of the article, or the right to retain legal liability.

Resources

  1. Related News: VS Remote Code published! Open a new era of remote development
  2. Official Help: https://code.visualstudio.com/docs/remote/ssh#_getting-started
  3. GitHub Address: https://github.com/microsoft/vscode (or can not handle the google mentioned in this issue)

Windows Installation

VS Code - Insiders download

Download: Portal
Here Insert Picture Description

Remote Development Extension Installer

Here Insert Picture Description

Download and install Openssh

Reference Help: Portal
using PowerShell, start as administrator

Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'

# This should return the following output:下面是返回的输出信息

Name  : OpenSSH.Client~~~~0.0.1.0
State : NotPresent
Name  : OpenSSH.Server~~~~0.0.1.0
State : NotPresent

Then, install the server and / or client functionality:

# Install the OpenSSH Client
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

# Install the OpenSSH Server
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

# Both of these should return the following output:两个的输出信息都如下面所示

Path          :
Online        : True
RestartNeeded : False

To configure the initial use OpenSSH on Windows server, start PowerShell, an administrator, and then run the following command to start the SSHD service:

Start-Service sshd
# OPTIONAL but recommended:
Set-Service -Name sshd -StartupType 'Automatic'
# Confirm the Firewall rule is configured. It should be created automatically by setup. 
Get-NetFirewallRule -Name *ssh*
# There should be a firewall rule named "OpenSSH-Server-In-TCP", which should be enabled

Example of use:

ssh username@servername

use

  1. Open VS Code, when landing automatically open a command line window, open the Settings Remote-SSH-Settings by ctrl + shift + p, set Remote.SSH: Show Login Terminal is true
    Here Insert Picture Description

  2. After installing the plug-in the lower left corner there will be a green icon, click to select several options will pop up in the command window
    Here Insert Picture Description

  3. You can select a piece of config files can also be directly input user@host(such as [email protected])
    Here Insert Picture Description
    Of course, you can also use the configuration file, the format is as follows:

    # Read more about SSH config files: https://linux.die.net/man/5/ssh_config
    Host 输入你的Host名字
        HostName 输入你的IP地址
        User 输入你的用户名
    
  4. Because I was selected user name and password, and therefore need to enter the password on the command line after landing. You need to enter the password below vs code. This requires a continuous input password several times, we must pay attention to watch.

  5. Open the folder was at the bottom of the password entered into the system, this is done click ok then this Haofan
    Here Insert Picture Description
    6. final image
    Here Insert Picture Description

postscript

This time to re-add it


Reference: VSCode Remote remote development and debugging

Guess you like

Origin blog.csdn.net/yh0503/article/details/89851899