GIT SSH配置已有秘钥
1.確保SSH已經(jīng)安裝
sudo apt-get install openssh-server2.確保HOSTS有github.com
127.0.0.1 localhost 127.0.1.1 ubuntu 20.205.243.166 github.com # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters3.把公私鑰放進~/.ssh后
xzj@ubuntu:~$ ssh -T git@github.com The authenticity of host 'github.com (20.205.243.166)' can't be established. ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'github.com,20.205.243.166' (ECDSA) to the list of known hosts. Hi xzj19940819! You've successfully authenticated, but GitHub does not provide shell access.注意這個fingerprint,如果對不上的話可能是HOSTS沒有配置好,我這里是ECDSA算法的
These are GitHub's public key fingerprints:SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8 (RSA) SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM (ECDSA) SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU (Ed25519)其他問題參考官方:
Authentication - GitHub Docs
其他流程:
Copy the SSH public key to your clipboard.
If your SSH public 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.
$ cat ~/.ssh/id_ed25519.pub # Then select and copy the contents of the id_ed25519.pub file # displayed in the terminal to your clipboardTip:?Alternatively, you can locate the hidden?.ssh?folder, open the file in your favorite text editor, and copy it to your clipboard.
In the upper-right corner of any page, click your profile photo, then click?Settings.
In the "Access" section of the sidebar, click??SSH and GPG keys.
Click?New SSH key?or?Add SSH key.
In the "Title" field, add a descriptive label for the new key. For example, if you're using a personal Mac, you might call this key "Personal MacBook Air".
Paste your key into the "Key" field.
Click?Add SSH key.
If prompted, confirm your GitHub password.
總結(jié)
以上是生活随笔為你收集整理的GIT SSH配置已有秘钥的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: MySQL单表数据量超1亿,根据 索引列
- 下一篇: flash电子书的书签功能