Jenkins SSH Credentials - johnttaylor/epc GitHub Wiki
Creating a SSH Key on a Windows host
- Open a power-shell window and type the following:
PS C:\Users\johnt> ssh-keygen -t ed25519 -C "[email protected]"
- This will create a
.ssh
sub-directory containing the new SSH keyPS C:\Users\johnt> dir .ssh Directory: C:\Users\johnt\.ssh Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 6/4/2023 6:18 PM 419 id_ed25519 -a---- 6/4/2023 6:18 PM 106 id_ed25519.pub -a---- 6/4/2023 6:20 PM 828 known_hosts -a---- 6/4/2023 6:20 PM 92 known_hosts.old
- The
id_ed25519
file is the private key. And the theid_ed25519.pub
is the public key. Both of these files are text files.
- The
- This will create a
Update GitHub with the public key
-
Login into the GitHub account
-
Go to
Settings
under the account -
Select
SSH and GPG Keys
-
Select
New SSH Key
-
Fill in the
Title
field, setKey type
field toAuthentication Key
, and copy the contents of the public key file into theKey
Window, and click theAdd SSH Key
button.
Update Jenkins with the private key
-
Select
Manage Jenkins
-
Select
Security/Credentials
-
Click
System
-
Click
Global credentials (unrestricted)
-
Click
Add Credentials
-
Enter SSH Private Key.