Jenkins SSH Credentials - johnttaylor/epc GitHub Wiki

Creating a SSH Key on a Windows host

  1. 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 key
      PS 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 the id_ed25519.pub is the public key. Both of these files are text files.

Update GitHub with the public key

  1. Login into the GitHub account

  2. Go to Settings under the account

  3. Select SSH and GPG Keys

  4. Select New SSH Key

  5. Fill in the Title field, set Key type field to Authentication Key, and copy the contents of the public key file into the Key Window, and click the Add SSH Key button.

Update Jenkins with the private key

  1. Select Manage Jenkins

  2. Select Security/Credentials

  3. Click System

  4. Click Global credentials (unrestricted)

  5. Click Add Credentials

  6. Enter SSH Private Key.