How to store credentials in Jenkins

To store username and passsword of anything like github, dockerhub

From Jenkins dashboard, click on Manage Jenkins Jenkins

Click on Manage Credentials

Jenkins

Click on Jenkins Jenkins

Click on Global credentials Jenkins

Click on Add Credentials Jenkins

Select kind as Username with password, enter username, password and enter unique id and click on OK Jenkins

To store ssh private key

Click on Add Credentials Select kind as SSH Username with private key enter the username, click on Enter directly and then click on Add and paste your private key and click on ok

Jenkins

Jenkins

To store any token eg: gitlab, Jfrog, artifactory and sonarqube token

Click on Add Credentials Select kind as Secret text enter the token, id and click on OK

Jenkins