I installed jenkins this way : https://linuxize.com/post/how-to-install-jenkins-on-debian-9/
Basically sudo apt install jenkins
while logged as root
I then created a hudson
user and used ssh-keygen
to generate a pair of keys.
I then tried to use the public key in the gerrit-trigger
plugin (https://plugins.jenkins.io/gerrit-trigger/)
However it tells me /home/hudson/.ssh/id_rsa
does not exist.
I’m guessing it’s a permission issue. when I use apt install jenkins
is there a way to specify in user hudson
?
Thnaks.
3
Answers
Jenkins installation created a jenkins user in debian.
I had do
su - jenkins
and then create a ssh key pair for itssh-keygen
Then the jenkins UI is able to read this one located in
/var/lib/jenkins/.ssh/id_rsa
Seems you created ssh keys using root user. You need to create ssh keys while logged in as hudson user or you can change path to
/root/.ssh/id_rsa
If you want to use hudson user’s path, login to hudson user first,
Then create ssh key pair:
Then you can confirm files using list command
if you see id_rsa file there, then you can put its address
/home/hudson/id_rsa
It seems this is permission related issue. Please change the permissions of all files in .ssh folder in /var/lib/jenkins to jenkins.
Also make similar configuration for hudson user’s ssh key: