Try it today VSCode new plug-ins: Remote develop plug-ins, the experience is very good, it can:
- Allows you to open the code on the remote machine in local development, and provide the same development experience and local
- Open the remote terminal VSCode
- Configure different plug-in on the development of different remote machine, the plug-in installed in a remote goal is to operate more smoothly
- You can also debug remote code locally: as breakpoints, single-step, etc. will not be less
- Support SSH tunnel (SSH Tunnel) connection, so you can debug code on a company computer at home.
- ……
This will be the way SSH connection, make an entry introduce more advanced features you need in the course of excavations slowly.
Configuration Steps
- In VSCode extended search bar
Remote - SSH
plug-in, click Install
-
Use
ssh-keygen
all 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]-----+ 复制代码
-
Will produce good public key is sent to the remote (using
ssh-copy-id
tool), you need the followinguser@your_remote_host
modifications 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. 复制代码
-
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 F1
key 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 home
directory 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:
Reproduced in: https: //juejin.im/post/5cf9d330e51d4550723b13c1