1. Generate an SSH Key
SSH is automatically installed on Linux and Mac systems, and Git Bash is required on Windows systems. First check whether SSH has been installed on the host. Enter SSH in the terminal.
Pub and id_rsa.pub are generated successfully. Id_rsa. pub is the public key, id_rsa is the private key, and they are both hidden files. This section describes where the public and private keys are generated. In Linux and Mac operating systems, Documents and Settings/username/.ssh are located. So how do you view their contents? You only need to run the following two commands.
cat id_rsa.pub
Copy the code
2. Add an SSH Key to GitHub
Add the public key ID_rsa. pub to GitHub and log in to GitHub to enter the setting interface, as shown in the figure below:
ssh -T [email protected]
Copy the code
If the preceding screenshot is displayed, the configuration is successful.