Vscode remote password-free login Linux server configuration method

Vscode remote password-free login Linux server configuration method

Execute ssh-keygen -t rsa -b 4096 in Windows cmd window

enter four times

2. Install the remote SSH plugin

 

 

 If there is no ~/.ssh folder, it means that Linux has not generated a key and needs to generate it

ssh-keygen -t rsa

touch  authorized_keys

 

 

chmod 700 ~/.ssh/

chmod 600 ~/.ssh/authorized_keys

If it is an ordinary user permission, it is best to give 600

Finally, open and copy the public key C:\Users\Administor/.ssh/id_rsa.pub file generated under the window to the authorized_keys file under Linux (open the editing method to gedit/vi), save and exit.

End, VScode remote login to Linux server no longer requires a password

Note : The IP of the virtual machine is automatically obtained by default. The IP will change due to abnormalities of the virtual machine and other circumstances, which will affect the remote connection. Therefore, it needs to be set to a static IP, and the static IP is a fixed value.

But because I didn't install ipptables myself, I couldn't successfully set a static IP——to be done, just pay attention to the suspension of the virtual machine every time

/etc/sysconfig/ , iptables filtering and firewall settings are not installed

Guess you like

Origin blog.csdn.net/moneyxjj/article/details/130702127