first, I'm doing this for past two days, but nothing works.
I've seen many tutorials, but no one works for me.
I have jenkins installed, in it I have Master node and I want to create new node. (some agent)
I want to establish connection with ssh.
I have jenkins user already on my new node and generated ssh key. (where is jenkins installed, there isn't jenkins user).
But the jenkins is telling me 'can't find known_hosts in /var/jenkins_home'. But this file exist. I checked if port 22 is open on my new node, and yes, it is, I can connect to it from my local PC.
Is there some other method, but it should be with SSH, not agent.rar.
What should I check?
EDIT:
-rw-r--r-- 1 root root 0 Oct 24 17:36 /var/lib/jenkins/.ssh
sudo -u jenkins ssh jenkins@*IP* ls -la .ssh
The authenticity of host '*IP* (*IP*)' can't be established.
ECDSA key fingerprint is SHA256:*FINGERPRINT*.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/var/lib/jenkins/.ssh/known_hosts).
Permission denied (publickey).