Thank you so much. It's working fine now. I was actually adding the path of the public key in the user's configuration and not the contents of the public key.
On Tuesday, October 9, 2012 3:54:55 PM UTC+5:30, mpapo - Michaël Pailloncy wrote: > > From what I understood, CLI authenticates the user according to the public > key stored in users Jenkins configuration. > So for this to work, we need the public key corresponding to the private > key that you specify in the command line is specified in the configuration > of the corresponding user. > > In your case, you have to add the public key corresponding to > /home/jenkins/.ssh/id_dsa.pub > in the configuration of sandy user in Jenkins. > CLI will match the private key specified in the command line with the > public key specified in the user configuration, and autentificates you as > sandy. > > Michaël > > > 2012/10/9 sandy <sandeep...@enterprisedb.com <javascript:>> > >> I do not have the user 'buildfarm' on Linux, where my jenkins is running. >> It is user 'sandy'. It seems I'm doing something funny here. Let me give >> you the details: >> >> Linux: >> -------- >> 1. jenkins running with user 'jenkins'. >> 2. In people list, I have added a user 'sandy'. (this is not the system >> user) >> >> Mac OS X: >> --------------- >> 1. this is the slave node. >> 2. user 'buildfarm' is the system user. >> 3. there is no user called 'sandy', or 'jenkins' here. >> >> The jenkins user on the master can login to slave node using buildfarm >> user, passwordless. >> >> >> >> >> >> On Tuesday, October 9, 2012 3:20:48 PM UTC+5:30, mpapo - Michaël >> Pailloncy wrote: >> >>> go http://jenkins-url:8080/user/b**uildfarm/configure and add the >>> public key to 'SSH Public Keys' >>> >>> 2012/10/9 Michaël Pailloncy <mpap...@gmail.com> >>> >>>> Do you have added the public key to the config of the user buildfarm ? >>>> >>>> Michaël >>>> >>>> 2012/10/9 sandy <sandeep...@enterprisedb.**com> >>>> >>>> Is it mandatory to have the 'jenkins' user on slave as well? I have it >>>>> only on Master. >>>>> >>>>> But the question is why is it working through UI and not from the >>>>> command line? Is there anyone who can help please? >>>>> >>>>> Thanks. >>>>> >>>>> >>>>> On Monday, October 8, 2012 6:25:10 PM UTC+5:30, sandy wrote: >>>>>> >>>>>> Is there any difference in the authentication for UI and Command line? >>>>>> >>>>>> I'm using Jenkins version 1.483. >>>>>> >>>>>> On Monday, October 8, 2012 3:16:43 PM UTC+5:30, sandy wrote: >>>>>>> >>>>>>> I have setup Jenkins master on Linux. The service is owned by user >>>>>>> 'jenkins'. I added one slave node (Mac OS X) and assigned a job to it. >>>>>>> The >>>>>>> build on this slave node is run by user 'buildfarm'. I have established >>>>>>> passwordless ssh between master and slave for user 'jenkins', which now >>>>>>> can >>>>>>> ssh to slave using 'buildfarm' user without giving password. When I >>>>>>> execute >>>>>>> build through UI, the build is properly done. >>>>>>> >>>>>>> Now, I was trying to build using command line on the master. and I >>>>>>> see the following error: >>>>>>> >>>>>>> $ id >>>>>>> uid=1006(jenkins) gid=1006(jenkins) groups=1006(jenkins) >>>>>>> >>>>>>> $ java -jar jenkins-cli.jar -s http://localhost:8080/ help >>>>>>> Failed to authenticate with your SSH keys. >>>>>>> >>>>>>> $ java -jar jenkins-cli.jar -s http://localhost:8080/ -i >>>>>>> /home/jenkins/.ssh/id_dsa help >>>>>>> Authentication failed. No private key accepted. >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>> >>> >