VSCode remote development plugin Quick

Try it today VSCode new plug-ins: Remote develop plug-ins, the experience is very good, it can:

  1. Allows you to open the code on the remote machine in local development, and provide the same development experience and local
  2. Open the remote terminal VSCode
  3. Configure different plug-in on the development of different remote machine, the plug-in installed in a remote goal is to operate more smoothly
  4. You can also debug remote code locally: as breakpoints, single-step, etc. will not be less
  5. Support SSH tunnel (SSH Tunnel) connection, so you can debug code on a company computer at home.
  6. ……

This will be the way SSH connection, make an entry introduce more advanced features you need in the course of excavations slowly.

Configuration Steps

  1. In VSCode extended search bar Remote - SSHplug-in, click Install

  1. Use ssh-keygenall the way Enter to create the tool ssh keys on the machine, create (note: Remote-SSH connection does not support plug-enter the account password to login preferred using asymmetric keys Login )

    $ ssh-keygen
    Enter file in which to save the key (/Users/fengyajie/.ssh/id_rsa): 
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /Users/fengyajie/.ssh/id_rsa.
    Your public key has been saved in /Users/fengyajie/.ssh/id_rsa.pub.
    The key fingerprint is:
    The key's randomart image is:
    +---[RSA 2048]----+
    |      .oo*++.+o++|
    |       +o Oo+ + +|
    |    . . o+ o   o |
    |.. o . +o .      |
    |o o o . S+       |
    |.o . .    .      |
    |+.E   . ..       |
    |o=.+ . . ..      |
    |.=*..   ..       |
    +----[SHA256]-----+
    复制代码
  2. Will produce good public key is sent to the remote (using ssh-copy-idtool), you need the following user@your_remote_hostmodifications to the user name and host name of your development machine

    $ ssh-copy-id -i ~/.ssh/id_rsa.pub user@your_remote_host
    usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/fengyajie/.ssh/id_rsa.pub"
    /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
    /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
    
    Number of key(s) added:        1
    
    Now try logging into the machine, with:   "ssh 'user@your_remote_host'"
    and check to make sure that only the key(s) you wanted were added.
    复制代码
  3. Try connecting, under normal circumstances, you can now log directly into the remote machine

    $ ssh 'user@your_remote_host'
    Welcome to Alibaba Cloud Elastic Compute Service !
    Last login: Thu Jun  6 20:32:13 2019 from $local_ip
    root@iZwz946zuZ:~#
    复制代码

Connect the remote machine

After the above configuration, you can use the machine VSCode connected to the distal, open VSCode, typing F1key input Remote-SSH:Connect to Host, the transport

Then enter you just configured user@your_remote_host, press Enter

At this point VSCode will open a new window in the lower left corner of the window, you will observe a green SSH status bar to indicate at this time you have connected a remote VSCode development machine, as follows

Next, you can open the top left corner of the file manager sidebar, click Open Folder, then you will be surprised to find that the remote homedirectory is listed here:

At this point, you have opened locally a "distal end development environment", then your development tasks no longer unlimited remote environment, and to have such an experience, let me thank the contribution of what Microsoft really as a conscience.

These are only just introductory presentation, allows you to quickly put together with this plug-in, more advanced features, it is recommended that you go read the official document content.

reference:

  1. Remote Development using SSH
  2. SSH PORT FORWARDING EXAMPLE
  3. PUBLIC KEY AUTHENTICATION FOR SSH

Reproduced in: https: //juejin.im/post/5cf9d330e51d4550723b13c1

Guess you like

Origin blog.csdn.net/weixin_33816300/article/details/91443221