当前位置:网站首页>Vscode usage - Remote SSH configuration description
Vscode usage - Remote SSH configuration description
2022-06-26 17:23:00 【jackailson】
By: Ailson Jack
Date: 2022.06.17
Personal blog :http://www.only2fire.com/
The address of this article on my blog is :http://www.only2fire.com/archives/147.html, Better layout , Easy to learn , You can also visit my blog , There may be something you want .
My environmental description :
- The local environment :Windows 11
- distal environment :Ubuntu 22.04 LTS( Running in a virtual machine )
Remote-SSH brief introduction
Remote-SSH It's a VSCode Plug in for ,Remote-SSH Can let you use any with SSH Serve the remote machine as your development environment . This can greatly simplify development and troubleshooting in various situations . Used Remote-SSH After the plug-in , You can :
- Develop on the same operating system you deploy , Or use a larger computer than the local computer 、 Faster or more specialized hardware .
- Fast switch between different remote development environments , And update it safely , Without worrying about affecting your local computer .
- Access existing development environments from multiple computers or locations .
- Debugging in other places ( Such as customer site or cloud ) Running applications .
Remote-SSH Installation and environmental preparation
First installation VSCode, Then search in the extension "Remote", Install the found "Remote-SSH" and "Remote-Containers","Remote-SSH: Editing Configuration" The plug-in will be installed "Remote-SSH" Automatically install plug-ins :
Ensure that the remote environment (Ubuntu 22.04 LTS) in SSH Service available .
Ensure that... Is supported in the local environment SSH, This can be done by installing Git To get SSH function .
SSH The key configuration
This section will be in Windows Generate on SSH secret key , And then deploy to Ubuntu 22.04 LTS In the system , So every time you restart VSCode after , Use Remote-SSH visit Ubuntu 22.04 LTS Files in the system , No need to enter the password manually .
Generate SSH The key file
stay Windows Execute the following commands on the system to generate SSH secret key :
ssh-keygen
After entering the above command , When waiting , Directly by ENTER The key remains the default , Knocking required 3 Time ENTER key , Then it will be in C:\Users\AilsonJack\.ssh
In the table of contents SSH The key file :id_rsa
and id_rsa.pub
.
Deploy the key file to Ubuntu
First , Ensure that the current user exists in the user directory .ssh
Catalog ( My full path here is :/home/ailsonjack/.ssh
), Execute the following order , Check whether there is... In the output information .ssh
Catalog :
ls -al ~
If it doesn't exist .ssh
Catalog , Then execute the following command to create :
mkdir ~/.ssh
adopt FTP,SFTP,samba And so on id_rsa.pub
File transfer to Ubuntu 22.04 LTS In the system /home/ailsonjack/.ssh
Directory .
Generate authorized_keys file
Get into /home/ailsonjack/.ssh
Catalog , Then use the following command , Generate authorized_keys
file :
cat id_rsa.pub > authorized_keys
Remote-SSH To configure
The following will describe Remote-SSH Some configuration of , complete Remote-SSH After configuration , You can go through Remote-SSH visit Ubuntu 22.04 LTS Files or folders in the system , It's like developing on a local computer .
open VSCode, Then click on the “ Remote Explorer ” Icon , Then click on the pinion in the upper right corner ( Set up ):
In the pop-up window , Choose the first , open config file , Then fill in the configuration information :
The text of the configuration information is as follows :
Host Ubuntu22.04
HostName 192.168.1.5
User ailsonjack
IdentityFile C:\Users\AilsonJack\.ssh\id_rsa
Notes to the above configuration information are as follows :
Host < Remote host name >
HostName < Remote host IP>
User < user name >
IdentityFile < This machine SSH Private key path >
After the above configuration , Get into “ Remote Explorer ” Options , Right click on the host name , And then choose “Connect to Host in Current Window” perhaps “Connect to Host in New Window”:
If the connection is successful , The lower left corner will display the currently connected host name :
Click on “ Open folder ” Can open Ubuntu Folder in the system , I opened it here Ubuntu In the system Linux Kernel folder , At this point we can be in Windows In the system , utilize VSCode Of Remote-SSH Plug in reading Ubuntu In the system Linux Kernel source code , Isn't it cool :
Install the plug-in to the remote system
When we're done with Remote-SSH After configuration ,VSCode Support in remote server Installing a plug-in . At this point, we can install plug-ins to the remote system according to our own needs , You can also install all local plug-ins to the remote system with one click :
Click the icon in the red box in the above figure , You can install all the local plug-ins to the remote system with one click .
Welcome to the official account of bloggers. ( WeChat search official account : Embedded in those things ), You can scan the following official account QR code ( To prevent the QR code of official account from being CSDN Dispose of , Something is added around the QR code picture , If the official account picture is really CSDN Processed , You can also directly visit my personal blog post to get the QR code picture of the official account ):
If there are any questions in the text, please correct them , After all, the level of bloggers is limited .
If this article helps you , Just remember to praise and pay attention to the blogger ^_^.
For better content, see my blog address :http://www.only2fire.com/archives/147.html
notes : Reprint please indicate the source , thank you !^_^
边栏推荐
- sql中ROUND和TRUNCATE的区别(四舍五入还是截取小数点后几位)
- 丰富专业化产品线, 江铃福特领睿·极境版上市
- Deployment and operation of mongodb partitioned cluster
- Detailed contract quantification system development scheme and technical description of quantitative contract system development
- 【推荐系统学习】推荐系统的技术栈
- Microservice architecture practice: business management background and SSO design: SSO design
- Introduction to distributed cache / cache cluster
- [C language] static modifies local variables
- Teach you to learn dapr - 5 Status management
- Environment setup mongodb
猜你喜欢
9、智慧交通项目(2)
MySQL index
Don't believe it, 98% of programmers are like this
Introduction to distributed cache / cache cluster
Platform management background and merchant menu resource management: Design of platform management background data service
[code Capriccio - dynamic planning] t583. Deleting two strings
halcon之区域:多种区域(Region)特征(5)
Teach you to learn dapr - 5 Status management
Sandboxed container: container or virtual machine
Wechat app mall, review products, upload commodity pictures, and score Commodity Services
随机推荐
When I was in the library, I thought of the yuan sharing mode
Leetcode 1169. Query invalid transactions (if the amount of data is small, this problem still needs to be solved by violent enumeration)
Microservice architecture practice: user login and account switching design, order query design of the mall
物联网协议的王者:MQTT
LeetCode——226. Flip binary tree (BFS)
ACL 2022 | zero sample multilingual extracted text summarization based on neural label search
【代码随想录-动态规划】T583、两个字符串的删除操作
类型多样的石膏PBR多通道贴图素材,速来收藏!
Uncover the secret of Agora lipsync Technology: driving portraits to simulate human speech through real-time voice
9、智慧交通项目(2)
Treasure and niche CTA animation material website sharing
Introduction to minimal API
Comp281 explanation
Platform management background and merchant menu resource management: access control design of platform management background
在国金证券开户怎么样?开户安全吗?
Here comes the hero League full skin Downloader
COMP5216 Mobile Computing Assignment 1 - Extending ToDoList app
【动态规划】剑指 Offer II 091. 粉刷房子
Use FST JSON to automatically generate faster JSON serialization methods
Microservice architecture practice: business management background and SSO design: SSO design