VScode uses the ssh key to connect to the remote server (avoid the trouble of repeatedly entering the password)

Local connection to remote cloud server:

Article Directory

Client

Install git bush
https://gitforwindows.org/

Insert picture description here
Then find a blank place (such as the desktop), right-click Git Bash Here and
Insert picture description here
create a pair of keys (public and private keys) in the command window to
create new ssh keys
$ssh-keygen -t rsa -C "[email protected] (your Mailbox)" on the
second line, you can select the location of the key storage. By default, enter directly. It is stored in the C drive/user/.ssh file, and the demonstration is stored in the D drive (for unified management).
Insert picture description here
Here are a few**

Precautions

**

1. If you want to create multiple keys, the same path will overwrite the previous one (that is, if all are default, only one key can be created ). The
key location is in the C drive user, ssh file

2. Change the creation location to fill in strictly according to the example path , otherwise you may never create successfully, or you may not find it at all
. 3. Path writing /X/XXX/XXX/(key name) key name must be filled in
D :\SSH is wrong, the path name of Windows is not applicable

The rest is always enter, no need to set a password (set it if you want to, it doesn’t make much sense)
back to D drive, at this time there are two files
Insert picture description here

If it is all default then
Insert picture description here

Service-Terminal

Take Alibaba Cloud as an example:
Install ssh
on Ubuntu system :
apt-get install ssh

Install ssh on centos system:
yum install openssh

And start
chkconfig sshd on

After the installation is complete, verify whether the SSH installation is successful.
Verification method:
execute the command in command line mode: ssh -V. The
result shows that the ssh version proved successful.
Insert picture description here
Use Insert picture description here
the key file in the directory to open and copy the content of the public key (suffix with pub) Go in

Insert picture description here
Insert picture description here
Then open vscode, use remote ssh to configure the server, and add the path of the private key (file without pub) in the last line
Insert picture description here

After the configuration is complete, you can directly click on the left to log in, no password is required

Guess you like

Origin blog.csdn.net/euphorias/article/details/104818566
Recommended