SSH key

SSH key

what is the key

A key is a very large number obtained through an encryption algorithm. Can be divided into two categories:

Symmetric encryption: Symmetric encryption requires only one key

asymmetric encryption: Two keys are required to be used in pairs, divided into public key and private key.

SSH key

SSH key login uses asymmetric encryption, and users log in through their own keys. Note:The private key must be kept by yourself and cannot be leaked, while the public key is public and can be sent and saved externally.
The public key and private key have a one-to-one relationship:Only the corresponding private key can decrypt the data encrypted by the corresponding public key.

Generate key

usessh-keygencommand generation

Basic usage

Direct inputssh-keygen
It will ask you to enter some basic things, including: storage location and name, password (the password can be empty),
Then it was created successfully, as shown below:

ssh-keygen common parameters

-t: (type) Specifies the encryption algorithm of the key (generally ed25519, rsa). If omitted, RSA will be used by default.ssh-keygen -t rsa

-b: (bits) specifies the number of binary digits of the key. The larger the value, the greater the encryption and decryption overhead, and the higher the security of the key. Generally set to 1024 or 2048.ssh-keygen -b 1024

-C: (comment) Specifies the comment of the key file, formatusername@host: ssh-keygen -t rsa -b 2048 -C [email protected]generate

Log in to Git using ssh key

OpengitWarehouse settings page (Coding is used in the screenshot):

Click Add Public Key and copy and paste the content of the public key created above. (You can drag it directly toVSCodeOpen in), confirm to save.
Then it’s ok

Related Posts

note_46: There is no response when entering adb in cmd. When entering cmd in git bash, segmentation fault is displayed.

Developers, what exactly are Docker images, containers and repositories?

Linux[JavaEE]——Building a JavaEE development environment (with software installation tutorial and download address)

ESXI 7.0 version configures N card graphics card pass-through

7 tools that can replace the top command

Use the make tool to compile all .c in any directory and link & specify the output directory

iOS Code Coverage (2) – Incremental Coverage Automation Practice

STM32+ESP8266+MQTT connects to Alibaba Cloud server (3. AT command connects to Alibaba Cloud platform)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>