Below commands are verified on RHEL 7 server
# Login as jenkins user
sudo su -s /bin/bash jenkins
# Generate a ssh key
ssh-keygen
# Press enter 3 times when prompt shows, give empty password
# Export public key
cat /var/lib/jenkins/.ssh/id_rsa.pub
# Login to you repo server with ssh
ssh user@your repo address
# Create authorized key under .ssh folder, paste the public key above printed
vi .ssh/authorized_keys
# Log out your git repo and go back to your jenkins pipeline job configuration, you should be able to add git repo to a job.