When using VScode to connect to a remote server, you must enter a password every time you open it, and log in using ssh or other methods, you must enter the password locally, which greatly reduces the user experience. The following summarizes the method of password-free login. It is easy to use Fits well, take off.
Table of contents
PowerShell Terminal Control
The local must be controlled in the PowerShell terminal, as follows:
order 1
After opening the terminal, enter the following command in the terminal:
ssh-keygen -t rsa
Enter and press Enter, enter y, press Enter again
order 2
Then enter the following command:
cat C:\Users\Administrator/.ssh/id_rsa.pub | ssh whq@192.168.21.94 "cat >> ~/.ssh/authorized_keys"
**Note:** Regarding the above command, you have to modify it according to your computer user name, remote server name and ip address. This is the setting of my own computer. Scholars refer to it for modification. (See the overall control demo diagram for details)
enter password
When prompted to enter a password, enter your own password to connect to the remote server: as follows:
Overall control demo
The demonstration of all the above command operations is shown in the figure below:
Test whether the password-free login is successful
After the above operations are completed, you can test whether the password-free login is set successfully, as follows:
Summarize
The above is (Windows) local connection to remote server (Linux), password-free login settings, I hope my method can help you, it is not easy to summarize, pay a lot, there are other good methods, welcome to leave a message to discuss.