Python small details solution (continuously updated)


Use VSCode access and modify remote files to implement in three steps: install RMate on the remote Linux machine; install OpenSSH on local Windows; install extended Remote vScode in VSCODE.

1. Install RMate on the remote Linux machine
Rmate has a lot of Chinese language versions. Here is a Python version. github address:

download and install is relatively simple, just execute the following commands in Linux

chmod +x ./rmate
mv ./rmate /usr/local/bin/rmate

2. Install OpenSSH in local Window

github address: needs to be compiled by itself. It is recommended to use the Window version of the installation package directly:

Recommended EXE version. If you download the installation version, you need to set the environment variable in Windows to decompress the BIN directory. The installation of running the SSH command will have the following prompts:

** You can directly run the SSH -Keygen -t RSA command to generate a key pair. Generally, the default folder will be in the .ssh folder in the current user directory. Implementing the remote Linux -free login in the command line of Windows, which is the same as the method in the Linux system. You can in the Authorized_Key file.

To make AUTHORIZED_KEY take effect, you need to modify the sshd_config file, mainly the following three items, you can cancel the notes **


vim /etc/ssh/sshd_config

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys

, execute the service SSHD RESTART command to restart the SSHD service

service sshd restart
cat >> authorized_keys
# Note the path of the file

Note that if the linux login user is not a root user, you need to modify the permissions of the following .ssh folders and Authorized_key files, otherwise it cannot be achieved by password -free login.

chmod 700 .ssh
cd .ssh/
chmod 600 authorized_keys

3. Install Remote VSCODE extension
Extended address:
After the installation is complete, click the Start Server in the panel to start the service (this step is necessary)
After opening the terminal ([View] – [Integrated terminal]), enter the following command:

 ssh -R 52698: Linux Username@linuxComputer IP address# Example
ssh -R 52698: [email protected]
ssh -R 52698: [email protected] -p 2159
# The above 2159 is the port number, just for example, SSH accesses the remote host through port 22 by default, this situation may change the port, or it may be the forwarding of the port.
rmate -p 52698Linux file name

The result will open the corresponding file:
** can be modified directly.

In addition, if you need to set up an expansion automatic start, just click [Working Area Settings], which will automatically add setting.json files **
In the file, set the following settings.
Finally, if a firewall is turned on, you need to open the 52698 port used.


Related Posts

Intent to pass data PARCLABLE, Serializable, Bundle detailed usage

javaee Learning Log (52): Response object, file download case, verification code case

MySQL InsertorUpDate is updated, and inserts in CAPPADOCIA when there is no existence

C# decimal number and ASCII code conversion XSZ

Python small details solution (continuously updated)

Random Posts

C# decimal number and ASCII code conversion XSZ

Caddy & GRPC (3) Add a reverse proxy plug -in to Caddy

nodejs knowledge point


webView and JS interact all methods and use