About addition of SSH keys to your account
You can access and write data in repositories on your GitHub Enterprise Server instance using SSH (Secure Shell Protocol). When you connect via SSH, you authenticate using a private key file on your local machine. For more information, see "About SSH."
After you generate an SSH key pair, you must add the public key to your GitHub Enterprise Server instance to enable SSH access for your account.
Prerequisites
Before adding a new SSH key to your account on your GitHub Enterprise Server instance, complete the following steps.
- Check for existing SSH keys. For more information, see "Checking for existing SSH keys."
- Generate a new SSH key and add it to your machine's SSH agent. For more information, see "Generating a new SSH key and adding it to the ssh-agent."
Adding a new SSH key to your account
After adding a new SSH authentication key to your account on your GitHub Enterprise Server instance, you can reconfigure any local repositories to use SSH. For more information, see "Switching remote URLs from HTTPS to SSH."
-
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.
-
在任何页面的右上角,单击个人资料照片,然后单击“设置”。
-
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 laptop, you might call this key "Personal laptop".
-
Paste your key into the "Key" field.
-
Click Add SSH key.
-
如果出现提示,请确认� 的帐户是否拥有 GitHub Enterprise Server 访问权限。 有关详细信息,请参阅“Sudo 模式”。