the user have not generated a ssh public/private key pair set before ?
This info is working on theChaw but can be applied to all other git repositories which support SSH pubkey authentications. (See gitolite, gitlab or github for example.)
First start by setting up your own public/private key pair set. This can use either DSA or RSA, so basically any key you setup will work. On most systems you can use ssh-keygen.
- First you'll want to cd into your .ssh directory. Open up the terminal and run:
cd ~/.ssh && ssh-keygen- Next you need to copy this to your clipboard.
- On OS X run:
cat id_rsa.pub | pbcopy- On Linux run:
cat id_rsa.pub | xclip- On Windows (via Cygwin/Git Bash) run:
cat id_rsa.pub | clip- Add your key to your account via the website. https://help.github.com/en/enterprise/2.15/user/articles/adding-a-new-ssh-key-to-your-github-account
- Finally setup your .gitconfig.
git config --global user.name "bob"git config --global user.email bob@...(don't forget to restart your command line to make sure the config is reloaded)Thats it you should be good to clone and checkout.
Further information can be found on https://help.github.com/articles/generating-ssh-keys (thanks to @Lee Whitney) -
the user have generated a ssh public/private key pair set before ?
- check which key have been authorized on your github or gitlab account settings
- tells which corresponding private key must be associated from your local computer
eval $(ssh-agent -s)
tell where the keys are located
ssh-add ~/.ssh/id_rsa
本文详细介绍了如何生成SSH公钥/私钥对,适用于GitHub、GitLab等支持SSH认证的Git仓库。从创建密钥对到配置.gitconfig,再到网站上添加公钥,一步步指导用户完成设置。
1695

被折叠的 条评论
为什么被折叠?



