美文网首页
连接到GitHub使用SSH

连接到GitHub使用SSH

作者: End_b4a7 | 来源:发表于2018-04-01 01:02 被阅读0次

你可以连接到GitHub使用SSH

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

Enter passphrase (empty for no passphrase):[Type a passphrase]

Enter same passphrase again:[Type passphrase again]

Adding your SSH key to the ssh-agent

Start the ssh-agent in the background.

eval "$(ssh-agent -s)"

Agent pid 59566

if you're using macOS Sierra 10.12.2 or later, you will need to modify your ~/.ssh/config file to automatically load keys into the ssh-agent and store passphrases in your keychain.

Host *

AddKeysToAgent yes

UseKeychain yes

IdentityFile ~/.ssh/id_rsa

Add your SSH private key to the ssh-agent and store your passphrase in the keychain. If you created your key with a different name, or if you are adding an existing key that has a different name, replace id_rsa in the command with the name of your private key file.

ssh-add -K ~/.ssh/id_rsa

Note: The -K option is Apple's standard version of ssh-add, which stores the passphrase in your keychain for you when you add an ssh key to the ssh-agent.

Adding a new SSH key to your GitHub account

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# Copies the contents of the id_rsa.pub file to your clipboard

Tip: If pbcopy isn't working, 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 user settings 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.

相关文章

  • 连接到GitHub使用SSH

    你可以连接到GitHub使用SSH ssh-keygen -t rsa -b 4096 -C "your_emai...

  • 使用SSH连接到GitHub

    关于SSH 使用 SSH 协议可以连接远程服务器和服务并向它们验证。 利用 SSH 密钥可以连接 GitHub,而...

  • 使用 SSH 连接到 GitHub(gitea)

    文档#### 关于 SSH→ 使用 SSH 协议可以连接远程服务器和服务并向它们验证。 利用 SSH 密钥可以连接...

  • [Mac] 使用 SSH 来连接到 GitHub

    如果你是第一次设置 SSH,那么一共有如下 5 个步骤: 在本地生成一个新的 SSH key;把新生成的 SSH ...

  • GIT相关

    一些用法 ssh配置代理 如果电脑联网需要走代理,然后发现git使用ssh协议无法连接到github,这里以win...

  • 电脑多个RSA文件,被github登录拒绝

    使用ssh连接github时候,由于多个rsa文件存在,被github拒绝, ssh -T git@github....

  • SSH Key生成

    使用Open SSH 生成ssh key 使用:Github:打开setting->SSH keys,点击右上角 ...

  • SSH keys以及在gitHub上配置

    使用过gitHub或者gitLab的同学都应该见过SSH keys,因为使用gitHub时候需要配置SSH key...

  • Git使用(三)

    用SSH连接GitHub 关于SSH: 使用SSH协议,你可以连接并验证远程服务器和服务。 使用SSH密钥,您可以...

  • Windows下配置SSH连接Github

    当使用git协议推送本地代码到远程时,需要配置ssh连接到GitHub。 设置账户 打开系统cmd。设置Git的u...

网友评论

      本文标题:连接到GitHub使用SSH

      本文链接:https://www.haomeiwen.com/subject/ivxocftx.html