How to encode on the remote server? Preferred vscode! ! ! Of course, there are many other options, such as sublime, ultraedit, etc. Here we use the very popular vscode to connect to the ubuntu server for explanation!
Search vscode on Baidu (note that it is not visual studio) and enter vscode official website Download. [Recommended learning: vscode tutorial, Programming teaching]
Extensions tab on the left, search for remote in the input box, and select to install Remote-SSHPlug-in.
After the installation is complete, a new tab, Remote Explorer, will be added on the left, as shown below:SSH TARGETS, as shown in the figure below:
Click the Add button, enter the address of the remote server, and modify the account number and IP according to your own situation, as shown below: After saving, the connection information will be stored inC:\Users\chaxun\.ssh\config .
At this point you can see the added remote server address inSSH TARGETS:
Connect to Host in Current Window:
If the remote server can be connected successfully, you will be asked to enter the password:/home/zhaxun After that, you will need to enter the password again:
If the above steps are successful, you will see all the files in the remote server directory in the file tab:
At this point, you can add, delete, modify, and check files just like operating local files!
Deleting files, renaming and other operations can be found in the right-click menu:
Of course, you can too Use shell commands in the terminal to operate!
What should I do if I want to open the remote server next time? This information will be stored in Remote Explorer, as shown in the figure below. At this time, you only need to right-click to open it again!
At this point, we have explained the detailed process of connecting vscode to the remote server!
For more knowledge about VSCode, please visit: vscode Basic Tutorial!
The above is the detailed content of Teach you step by step how to use vscode to connect to a remote server. For more information, please follow other related articles on the PHP Chinese website!