in Education by
I am successfully able to connect to a remote machine using SSH but when I am launching the agent from Jenkins it throws the following error: ERROR: Server rejected the 1 private key(s) for user1 (credentialId:xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/method:publickey) [01/19/17 05:35:15] [SSH] Authentication failed. hudson.AbortException: Authentication failed. at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1219) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:714) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:709) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) [01/19/17 05:35:15] Launch failed - cleaning up connection [01/19/17 05:35:15] [SSH] Connection closed. I can establish SSH connection from a master machine to the node machine using user1, however, when I am trying to launch the agent using user1 from Jenkins it is rejecting the private key. Is there any solution to overcome this issue? Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
The solution to overcome this problem is Goto slave node switch to the root user sudo su Add a user to jenkins home using useradd -d /var/lib/jenkins jenkins Here /var/lib/jenkins is having my home directory Now, from jenkins master copy the id inside id_rsa.pub from jenkins user cat /var/lib/jenkins/.ssh/id_rsa.pub Now, create an authorized_keys file for jenkins user form slave node mkdir /var/lib/jenkins/.ssh And create an authorized_keys file vi /var/lib/jenkins/.ssh/authorized_keys Paste the id that you have copied from id_rsa.pub here and save the file with “:wq!”. This will help you to resolve the issue. For more information please go through the following tutorial to get more info about jenkins:

Related questions

0 votes
    I am successfully able to connect to a remote machine using SSH but when I am launching the agent from Jenkins ... overcome this issue? Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    I am trying to do a poc of Jenkins pipeline as code. I am using the Github organization folder plugin to ... descriptions for the jobs Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    In deploy scenario I need to create and run Jenkins task on the list of hosts, i.e. create something like a ... anyone help with it? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    In Jenkins, is there a way to restrict the user to view only certain jobs? Only through "Project-based ... allows job restriction? Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    Can someone help me to differentiate between DevOps and Docker? Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    I'm working to set up Panda on an Amazon EC2 instance. I set up my account and tools last night and had no ... would be a great help! Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    I have a Jenkins project that does a gradle build and uploads build artifacts to a Nexus maven hosted ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    How do I change the key pair for my ec2 instance in AWS management console? I can stop the instance, I can ... instance's key pair. Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    The question as the title. Why is this, I have used the ssh command: ssh -i mykey.pem root@xxx-xxx-xx-xx-xxx ... What am I doing wrong? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    Hello I am trying to upload some files to the amazon S3 bucket but I am facing an error that the key is ... 't exist Please help. Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    I'm trying to configure my Jenkinsfile to run in one which already have access to my git repository via ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 8, 2022 in Education by JackTerrance
0 votes
    I am trying to start the redis service on the Redis Server on Unbuntu 16.04 and I am facing this error: Failed ... you please help me? Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    I need to know of any way to access a running instance in Amazon EC2. I DON'T have the original keypair ". ... or assign a new keypair? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I need to know of any way to access a running instance in Amazon EC2. I DON'T have the original keypair ". ... or assign a new keypair? Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    I cannot SSH into my instance - Operation timed out. What could be the reasons why, and what can I do to ... because of memory issues. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
...