If the user has not generated a ssh public/private key pair set before
(如果用户之前未生成ssh公用/专用密钥对)
This info is working on theChaw but can be applied to all other git repositories which support SSH pubkey authentications.
(该信息在theChaw上有效,但可以应用于支持SSH pubkey身份验证的所有其他git存储库。)
(See gitolite , gitlab or github for example.) ((例如,请参见gitolite ,gitlab或github。))
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. (它可以使用DSA或RSA,因此基本上您设置的任何密钥都可以使用。)
On most systems you can use ssh-keygen. (在大多数系统上,您可以使用ssh-keygen。)
- First you'll want to cd into your .ssh directory.
(首先,您需要CD进入.ssh目录。)
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
(在OS X上运行: cat id_rsa.pub | pbcopy
) cat id_rsa.pub | pbcopy
- On Linux run:
cat id_rsa.pub | xclip
(在Linux上运行: cat id_rsa.pub | xclip
) cat id_rsa.pub | xclip
- On Windows (via Cygwin/Git Bash) run:
cat id_rsa.pub | clip
(在Windows上(通过Cygwin / Git Bash)运行: cat id_rsa.pub | clip
) cat id_rsa.pub | clip
- Add your key to your account via the website.
(通过网站将密钥添加到您的帐户。)
- Finally setup your .gitconfig.
(最后设置您的.gitconfig。)
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) -
(有关更多信息, 请参见https://help.github.com/articles/generating-ssh-keys (感谢@Lee Whitney)-)
If the user has generated a ssh public/private key pair set before
(如果用户之前已生成ssh公用/专用密钥对)
eval $(ssh-agent -s)
tell where the keys are located
(告诉钥匙在哪里)
ssh-add ~/.ssh/id_rsa
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…