In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the example of vscode remote debugging Node program, the article is very detailed, has a certain reference value, interested friends must read it!
Remote environment configuration
First of all, you need to turn on the SSH server function in the remote server. The ubuntu system basically comes with it. If not, install it.
Apt-get install openssh-server local installation of the vscode plug-in
Download the VScode Insider version, and then install the Remote Development extension. After installing the Remote Development extension, other Remote-SSH will be installed automatically. If not, please install it manually according to the screenshot.
To configure user name / password authentication, you need to edit the settings.json file of VSCode and open it as shown in the following figure. Click setting, and click any 'Edit in settings.json'.
Then add "remote.SSH.showLoginTerminal": true to settings.json
Click "open a remote window" in the lower left corner and select 'connect to Host'
Open the config file according to the picture order, and fill in the Host and login name of the remote host
A new window pops up and, as prompted, enter the password for linux
After you have connected, click File-> Open folder (or file) to display the folder (or file) of linux.
Configure public key
The above steps require entering a password every time, which is very troublesome. You can solve this problem by configuring the public key.
1. Open the installation directory of Git and place Git\ usr\ bin in the environment variable.
2. Then open the directory of the host config file C:\ Users\ ye\ .ssh (different computers have different user names), and execute ssh-keygen.
Just enter on the road! After completion, there are two more id_rsa,id_rsa.pub files.
3. We need to copy a copy of the id_rsa.pub file to the linux server ~ / .ssh / directory. If you do not have this directory, execute mkdir ~ / .ssh creation, and then transfer id_rsa.pub to this directory remotely.
4. Then change to this directory and execute cat id_rsa.pub > > authorized_keys
5. Modify the file under / etc/ssh/sshd_config
PubkeyAuthentication yes
AuthorizedKeysFile .ssh / authorized_keys .ssh / authorized_keys2, are the two entries normal? if there are any comments, please cancel them. If they are different, modify or add them.
6. Restart the ssh service / etc/init.d/ssh resart of the remote host
7. Then go back to the command line of Windows and execute ssh (user name) @ 192.168.160.132
Please replace the words in parentheses with your Linux user name. Be sure to log in according to this format. Be sure to enter the user name and IP, not just IP.
When you open the file at this time, you will no longer be prompted for a password.
Remote debugging
Find the path to the node in the remote server
Which node
Add configuration in launch.json
{/ / Use IntelliSense to learn about possible attributes. / / Hover to view descriptions of existing attributes. / / For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [{"type": "node", "request": "launch", "name": "Launch Program", "program": "${workspaceFolder} / server/server.js" "runtimeExecutable": "/ root/.nvm/versions/node/v8.6.0/bin/node" / / add this line}]} above is all the content of the article "examples of vscode remote debugging Node programs" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.