Before adding a new SSH key to your account on tu instancia de GitHub Enterprise Server, you should have:
After adding a new SSH key to your account on tu instancia de GitHub Enterprise Server, 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.
$ pbcopy < ~/.ssh/id_ed25519.pub # Copies the contents of the id_ed25519.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. -
En la esquina superior derecha de cualquier página, da clic en tu foto de perfil y después da clic en Configuración.
-
En la barra lateral de configuración de usuario, da clic en Llaves SSH y GPG.
-
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.
-
Si se te solicita, confirma tu contraseña GitHub Enterprise Server.
-
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.
$ clip < ~/.ssh/id_ed25519.pub # Copies the contents of the id_ed25519.pub file to your clipboard
Tip: If
clip
isn't working, you can locate the hidden.ssh
folder, open the file in your favorite text editor, and copy it to your clipboard. -
En la esquina superior derecha de cualquier página, da clic en tu foto de perfil y después da clic en Configuración.
-
En la barra lateral de configuración de usuario, da clic en Llaves SSH y GPG.
-
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 Enterprise Server password.
-
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 clipboard
Tip: Alternatively, you can locate the hidden
.ssh
folder, open the file in your favorite text editor, and copy it to your clipboard. -
En la esquina superior derecha de cualquier página, da clic en tu foto de perfil y después da clic en Configuración.
-
En la barra lateral de configuración de usuario, da clic en Llaves SSH y GPG.
-
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 Enterprise Server password.
Para aprender más sobre el CLI de GitHub, consulta la sección "Acerca del CLI de GitHub".
Before you can use the CLI de GitHub to add an SSH key to your account, you must authenticate to the CLI de GitHub. For more information, see gh auth login
in the CLI de GitHub documentation.
To add an SSH key to your GitHub account, use the ssh-key add
subcommand, specifying your public key.
gh ssh-key add key-file
To include a title for the new key, use the -t
or --title
flag.
gh ssh-key add key-file --title "personal laptop"
If you generated your SSH key by following the instructions in "Generating a new SSH key", you can add the key to your account with this command.
gh ssh-key add ~/.ssh/id_ed25519.pub