SSH & SSH keys

Using the SSH protocol, you can connect and authenticate to remote servers and services. With SSH keys, you can connect to GitHub without supplying your username or password at each visit.

Before you generate an SSH key, you can check to see if you have any existing SSH keys.

1.Open Terminal.
2.Enter ls -al ~/.ssh to see if existing SSH keys are present:
ls -al ~/.ssh

SSH & SSH keys
image.png

存在。

Copy the SSH key to your clipboard.

If your SSH key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don't add any newlines or whitespace.
pbcopy < ~/.ssh/id_rsa.pub

Testing your SSH connection

1.Open Terminal.
2.Enter the following:

ssh -T [email protected]

出现这个:
Hi aikuyun! You've successfully authenticated, but GitHub does not provide shell access.