Skip to content

Latest commit

 

History

History
43 lines (37 loc) · 1.37 KB

File metadata and controls

43 lines (37 loc) · 1.37 KB

Creating a secret from source code SSH key authentication

SSH key based authentication requires a private SSH key.

The repository keys are usually located in the $HOME/.ssh/ directory, and are named id_dsa.pub, id_ecdsa.pub, id_ed25519.pub, or id_rsa.pub by default.

Procedure
  1. Generate SSH key credentials:

    $ ssh-keygen -t rsa -C "your_email@example.com"
    Note

    Creating a passphrase for the SSH key prevents {product-title} from building. When prompted for a passphrase, leave it blank.

    Two files are created: the public key and a corresponding private key (one of id_dsa, id_ecdsa, id_ed25519, or id_rsa). With both of these in place, consult your source control management (SCM) system’s manual on how to upload the public key. The private key is used to access your private repository.

  2. Before using the SSH key to access the private repository, create the secret:

    $ oc create secret generic <secret_name> \
        --from-file=ssh-privatekey=<path/to/ssh/private/key> \
        --type=kubernetes.io/ssh-auth