Please visit my website and subscribe to my youtube channel for more articles
In this blog, we will explore how to Setup SSH between Jenkins and Github for achieving the passwordless connection . Using this approach, you do not need to provide your credentials to configure the git repo in your Jenkins job
Agenda:
- Setup a user
jenkins
on your Jenkins server - Generate the SSH keys
- Copy the the public key in Github
- Configure in Jenkins Credentials
- Configure a sample job in Jenkins using SSH connection
Prerequisite:
- Jenkins should be installed
- Github account
Setup jenkins
user on jenkins server
- Generate the ssh keys
- Ensure the ssh-agent is running
sudo -su jenkinsssh-keygen
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa