Recall & Review
beginner
What is the purpose of storing credentials in Jenkins for Git access?
Jenkins stores credentials securely to allow automated access to Git repositories without exposing passwords or tokens in job configurations.
Click to reveal answer
beginner
Name two types of credentials Jenkins supports for Git access.
Jenkins supports Username with password and SSH private key credentials for Git access.
Click to reveal answer
beginner
How do you add Git credentials in Jenkins?
Go to Jenkins dashboard → Manage Jenkins → Manage Credentials → Select domain → Add Credentials → Choose type (e.g., SSH Username with private key) → Fill details → Save.
Click to reveal answer
intermediate
What is the benefit of using SSH keys over username/password for Git access in Jenkins?
SSH keys provide stronger security and avoid storing plain passwords. They also allow password-less authentication once set up.
Click to reveal answer
intermediate
How does Jenkins use stored Git credentials in a pipeline script?
In a pipeline, you use the 'credentialsId' to reference stored credentials when checking out code, for example: checkout([$class: 'GitSCM', userRemoteConfigs: [[url: 'repo_url', credentialsId: 'my-cred-id']]]).
Click to reveal answer
Which Jenkins menu lets you add Git credentials?
✗ Incorrect
Credentials are managed under Manage Jenkins → Manage Credentials.
What type of credential is recommended for secure Git access in Jenkins?
✗ Incorrect
SSH private keys provide secure, password-less authentication.
In a Jenkins pipeline, how do you specify which credentials to use for Git checkout?
✗ Incorrect
The 'credentialsId' links the stored credentials to the Git checkout step.
What happens if you do not configure Git credentials in Jenkins for a private repo?
✗ Incorrect
Private repos require authentication; without credentials, Jenkins cannot clone.
Which credential type allows Jenkins to authenticate with GitHub using a personal access token?
✗ Incorrect
Secret text credentials can store personal access tokens for GitHub.
Explain how to securely add and use Git credentials in Jenkins for a private repository.
Think about Jenkins menus and pipeline usage.
You got /4 concepts.
Describe the advantages of using SSH keys over passwords for Git access in Jenkins.
Consider security and automation benefits.
You got /4 concepts.