git configure SSH public key

Gitee provides a Git service based on the SSH protocol. Before using the SSH protocol to access the warehouse, you need to configure the account SSH public key.

First check whether the key exists on this machine. If the id_rsa (private key) and id_rsa.pub (public key) files exist, it means they have been created and can be copied directly.

$ ls ~/.ssh

If you don't need this key, you can delete it. Note that this key is not in use. It cannot be restored after being removed. You also need to use a new one in the place where it was used before:

$ rm -rf ~/.ssh/id_rsa
$ rm -rf ~/.ssh/id_rsa.pub

Generate SSH public key

Windows users are recommended to use Windows PowerShell or Git Bash. There are no cat and ls commands in the command prompt.

1. Generate SSH Key through the command ssh-keygen:

ssh-keygen -t ed25519 -C "Gitee SSH Key"
  • -t key type
  • -C comment

Output, such as:

Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/git/.ssh/id_ed25519):
Enter passphra

Guess you like

Origin blog.csdn.net/Quentin0823/article/details/133787358