How to Setup Linux Master Slave Agent in Jenkins with SSH-KEY ?| EP 05 | Common Mistakes by Engineer

Поділитися
Вставка
  • Опубліковано 12 гру 2024

КОМЕНТАРІ • 144

  • @martinb3523
    @martinb3523 10 місяців тому +3

    You really helped me when you found the hostname and the correct username, I should've come to this video 12 hours earlier! Thank's man

    • @devopsvijay
      @devopsvijay  10 місяців тому

      Glad it helped, stay connected and keep learning

  • @akhileshreddy3222
    @akhileshreddy3222 10 місяців тому +2

    I have gone through many videos and wasted lot of my time. But this video helped me a lot in understanding the concept. A huge thanks.......!!!!!!!

  • @humza277
    @humza277 Рік тому +3

    Spent ages trying to get this to work, this tutorial has everything needed +1

  • @joshua_hc_cr
    @joshua_hc_cr 10 місяців тому

    Thank you! For those who are having trouble connecting, please ensure that you are creating the files and folders under the correct user (root) and not the default 'home' user."

    • @devopsvijay
      @devopsvijay  9 місяців тому

      Thanks for the suggestion.
      This will help the viewers.

    • @peca_gabriel
      @peca_gabriel 5 хвилин тому

      exactly

  • @Pankaj-zw9wi
    @Pankaj-zw9wi Рік тому +2

    found this solution after 2 months, thank you

  • @lolitaad19
    @lolitaad19 День тому +1

    OMG thank you very much.. none of the paid udemy courses have this.. thank u very very much..
    Subscribed your channel

  • @peca_gabriel
    @peca_gabriel 11 хвилин тому

    Finally its working for me. I lost hours and hours to fix the connection issue. And now its working thanks to your coping public key in the autorizatyion file.
    Damn, after that I was establish connection but its was not stable ... i needed to update my java version on agent. The course I am following def not updated JDK11 on the slave and JDK21 on master. Unlike others I needed 1 full day to find the solution. But I am a little bit crazy when troubleshooting :D

  • @workwithmayuresh
    @workwithmayuresh Рік тому +2

    Thanks a ton bro ! Finally after wasting so many hours on youtube... this worked for me ! ❤

    • @devopsvijay
      @devopsvijay  Рік тому +1

      Glad it helped. Stay connected and keep learning

  • @thefamily512
    @thefamily512 11 місяців тому +5

    Jenkins is one of the most counter intuitive things out there when it comes to simple things like adding nodes or upgrading. It should not be this cumbersome.

    • @devopsvijay
      @devopsvijay  10 місяців тому

      yes, Very True. but mostly it will be like one time setup/pain.

  • @satendrakumar-ue4ze
    @satendrakumar-ue4ze 3 місяці тому +1

    Thanks brother... explained in very simple way... I really apricated Thanks.

    • @devopsvijay
      @devopsvijay  3 місяці тому

      Thanks, Glad it was helpful..

  • @satheeshbabu9310
    @satheeshbabu9310 Рік тому +1

    Nice and grisp, and much needed one. Many skip this part

  • @tinkertin
    @tinkertin Рік тому +3

    After going through alot of video for agent setup, finally this one helped.
    Noone shows the authentication failed issue. Finally got to know how this is resolved.
    Thank you!
    Can you also make a video for setting up agent in windows?

    • @devopsvijay
      @devopsvijay  Рік тому

      Glad i could help @aishwarya!!!..
      i have created video for slave agent setup in windows also.
      ua-cam.com/video/VwliiaOI5po/v-deo.html
      Keep learning with me .Stay connected with my channel :) . Do subscribe the channel for more updates : )
      #devopsvijay

  • @ppankaj58
    @ppankaj58 10 місяців тому +1

    Thanks Vijay you save job🙏

  • @509swetha6
    @509swetha6 6 місяців тому +1

    Thank you so much. My issue got resolved.🎉

  • @GayanendraShakya
    @GayanendraShakya Рік тому +1

    Really nice and easy steps you describes thanks

    • @devopsvijay
      @devopsvijay  Рік тому

      Glad it helped. Like subscribe and share for much videos. Thanks

  • @kranthichamp3002
    @kranthichamp3002 Рік тому +1

    good information broo..very helpful keep going

  • @rupachandu1211
    @rupachandu1211 Рік тому +1

    Thank you for the detailed information. The issue got resolved. Thank you

    • @devopsvijay
      @devopsvijay  Рік тому

      Glad it helped
      Please Like share & subscribe . Stay connected and keep learning

  • @SandeepSingh-hn6it
    @SandeepSingh-hn6it Рік тому +1

    May you can increase the font size.. not sure if okay my feedback :)

    • @devopsvijay
      @devopsvijay  Рік тому

      Yes, Thanks alot for your feedback, i have noted it down.

  • @nehaslittleworld
    @nehaslittleworld Рік тому +1

    Thanks for the info. Very helpful

  • @SandeepSingh-hn6it
    @SandeepSingh-hn6it Рік тому +1

    Vijay, this is really helpful, but I noticed only you are replying who said good, but I didn't seen any reply who are asking any doubts of error as commented

    • @devopsvijay
      @devopsvijay  Рік тому

      Thanks sandeep for feedback.
      For errors, mostly i see the error code.
      Without background scenario i can't answer exactly.
      I try answering for some generic errors and question,
      Thanks.

  • @sai-yq8pw
    @sai-yq8pw Рік тому +1

    Great explaination

  • @AnamikaKumari-vf6js
    @AnamikaKumari-vf6js 6 місяців тому +1

    Thank you you are amazing. It worked

  • @venkatprasad2205
    @venkatprasad2205 Рік тому +1

    Thanks for the video bro. The logs says agent is missing java installation? is it mentioned in the video?

    • @devopsvijay
      @devopsvijay  Рік тому

      java is must for jenkins and it's agent to work. that is mandatory requirement for jenkins.
      i have covered that part in jenkins introduction video.

  • @MaheswarKetha
    @MaheswarKetha 8 днів тому

    Is there a time limit for the number of executors? For example, if I run 10 jobs in parallel, will those jobs run indefinitely?

  • @Its_shubhamaws
    @Its_shubhamaws 8 місяців тому +1

    Awesome Vijay.
    can we connect for a quick question?

  • @marcocallisaya5678
    @marcocallisaya5678 Рік тому +1

    excelent guide. Thanks

  • @sivashankarreddy9858
    @sivashankarreddy9858 Рік тому +1

    Very helpful bro thanks

  • @mandlik1996
    @mandlik1996 Рік тому +1

    Thank you Vijay.

    • @devopsvijay
      @devopsvijay  Рік тому

      please Like and subscribe for more devops related videos

  • @Harsh_TruthYT
    @Harsh_TruthYT Рік тому +1

    Nice and simple.. great work.
    Can you plan some session on ssh also!!

    • @devopsvijay
      @devopsvijay  Рік тому

      Yes for sure

    • @devopsvijay
      @devopsvijay  Рік тому +1

      @sadanand Created video on ssh ua-cam.com/video/1_v7NXaDYkw/v-deo.html
      Take a look. Feedback would be appreciated

  • @NdiforJefferson-e9p
    @NdiforJefferson-e9p Місяць тому

    please help with a video on how to create a job using SLAVE agent

    • @devopsvijay
      @devopsvijay  Місяць тому

      Sure. Noted it. Thanks for suggestion

  • @SandeepSingh-hn6it
    @SandeepSingh-hn6it Рік тому +1

    Thanks ! my jenkins are running Centos and I am connecting agent as Ubuntu22.4.
    1.Creating SSH key on agent Ubuntu machine. 2. using id_rsa as private during node creation 3. copy id_rsa_pub into authorized key file in same machine
    ERROR: Server rejected the 1 private key(s) for ubuntu (credentialId:devopstest/method:publickey)

    • @devopsvijay
      @devopsvijay  Рік тому

      Couple of things might go wrong in this rejection
      Extra space while pasting private key in jenkins creds
      Private key file and authorized key file permission
      Make sure these 2 files are kept under correct user and correct location.
      And i see file name which u pastes is id_rsa_pub i believe dot should be there like id_rsa.pub

  • @alexanderlazarogomezvaldiv4336

    Thanks for sharing

    • @devopsvijay
      @devopsvijay  Рік тому

      Thanks for watching! Please like and subscribe and stay connected for more such videos.

  • @ObulReddyM-gn8wh
    @ObulReddyM-gn8wh 10 місяців тому +1

    How you are taking root remote directory and why your taking it?

    • @devopsvijay
      @devopsvijay  10 місяців тому

      Remote root directory is nothing but working directory for an agent.
      You can select any directory. Which has access to jenkins agent

  • @anandhakumarg6032
    @anandhakumarg6032 Рік тому +1

    In Windows, jenkins has private key of linux copied. But it doesnt have the public key of linux. How does the communication established between. I was just wondering about it. Thanks if you could help me out.

    • @devopsvijay
      @devopsvijay  Рік тому

      In windows you can use jnlp method to connect windows agent.

  • @varunbc
    @varunbc 10 місяців тому

    hi vijay, please make a video of connecting ssh to linux server for command execution from windows jenkins server as a domain user

    • @varunbc
      @varunbc 10 місяців тому

      please check this

    • @devopsvijay
      @devopsvijay  9 місяців тому

      Thanks @varunbc for suggestion.
      Noted it .

  • @shaikkurshid1711
    @shaikkurshid1711 9 місяців тому +1

    Hello Viay.Thanks for your vidoe .Can you please help me to fix this issue i am getting this issue SSH Connection failed with IOException Key exchange was not finished connection is closed retrying in 15 seconds There are 5 more retries left

    • @devopsvijay
      @devopsvijay  9 місяців тому

      Please go over the previous comments,
      I had mentioned couple of resolution to solve this issue.
      Might be helpful for u.
      Thanks

  • @RM-xu3dv
    @RM-xu3dv Рік тому +1

    When i install Jenkins on ec2, im getting only 2 options in launch method. Only first and third option, middle one is not coming, whats the reason

  • @Momandshanvi
    @Momandshanvi 2 місяці тому +1

    Sir I have a doubt, I have created a master and slave machines with a passwordless authentication. I copied the ssh-key generated(tpublic) on the master machine to both of the slave machines(.ssh/authorized_keys). Now when i launch nodes for both the machines, it rejecting the private key. can i generate a ssh key in slave machine and use the private rsa keys to authenticate for nodes?

    • @devopsvijay
      @devopsvijay  2 місяці тому

      Yes you can use ssh key generated on slave box also

  • @nagaedu1524
    @nagaedu1524 Рік тому +1

    Thanks bro

  • @ArunkarthickRajan
    @ArunkarthickRajan Рік тому

    In my screen, there is NO Authorized keys, icant copy paste public key.. please clear

  • @sumitraii4566
    @sumitraii4566 3 місяці тому +1

    how to deploy war file from jenkins on windows to linux agent on tomcat conatiner?

    • @devopsvijay
      @devopsvijay  3 місяці тому

      Once linux agent is connected as slave.
      The deploying war file in tomcat process is same for windows and linux.
      Take a look at this video, might be helpful
      ua-cam.com/video/fuelx5j1HA8/v-deo.html

  • @alfrieghtsnalam7507
    @alfrieghtsnalam7507 Рік тому +1

    i follow what you done still i have error my slave cannot connect becoz of the private key i put in there in credential is not recognize hahiast

    • @devopsvijay
      @devopsvijay  Рік тому

      Might be there is some extra line at the end.

  • @Belief-tv6rl
    @Belief-tv6rl 6 місяців тому +1

    ERROR: Server rejected the 1 private key(s) for ec2-user (credentialId:jenkins-slave/method:publickey)
    authentication failed
    what should i have to do ? bro

    • @devopsvijay
      @devopsvijay  6 місяців тому

      Thanks for pasting the error.
      Check the comments history, you will find the solution i had pasted sometime back.

  • @yashwanththati1001
    @yashwanththati1001 Рік тому +1

    hi , i am using mac os and in terminal in created ssh keys using ssh-keygen i am getting only 2 files , i am not getting authorized_keys file idk why any. one help ?

    • @devopsvijay
      @devopsvijay  Рік тому

      Authorized_keys will not get generated automatically.
      You have to create manually.

  • @PaulPiermarini
    @PaulPiermarini Рік тому +1

    Great demo but after going through the exact steps I still have this error (i'm on rhel 8)......[10/06/23 12:12:26] [SSH] Opening SSH connection to 10.xx.xxx.163:22.
    [10/06/23 12:12:26] [SSH] SSH host key matched the key required for this connection. Connection will be allowed.
    ERROR: Server rejected the 1 private key(s) for jenkins (credentialId:SSH_CONNECT_AGENT/method:publickey)
    [10/06/23 12:12:26] [SSH] Authentication failed.
    Authentication failed.
    [10/06/23 12:12:26] Launch failed - cleaning up connection
    [10/06/23 12:12:26] [SSH] Connection closed.

    • @devopsvijay
      @devopsvijay  Рік тому

      There could be couple of reason of authentication failed.
      1 . Make sure chmod permission of authorized_keys is correct. Where you have pasted public key.
      2. Private key present in jenkins. There should be no extra line while pasting.

  • @sravanigundepalli3513
    @sravanigundepalli3513 8 місяців тому

    Is it possible to run build on same server or system when we create slave naming other systems
    My target is to build 6 jobs parallelly containing same code but with different parameter change. how can i achieve this?

  • @Mr.Dhanush-o7t
    @Mr.Dhanush-o7t 10 місяців тому +1

    😢not working .... In authorized key folder I already have public key but not private key so I copied private key into that directory still not working and before it I tried many times still not working

    • @devopsvijay
      @devopsvijay  10 місяців тому

      You can create new private and public key using ssh-keygen command.
      You should always use it in pair.

    • @Mr.Dhanush-o7t
      @Mr.Dhanush-o7t 10 місяців тому +1

      @@devopsvijay ok thank you

  • @austinaisosa2401
    @austinaisosa2401 7 місяців тому +1

    mine is always showing offline how do i sort it out

    • @devopsvijay
      @devopsvijay  7 місяців тому

      paste the error in comment, which you might be getting

  • @dileeppulabala1896
    @dileeppulabala1896 Рік тому +1

    Hi bro getting error after following the same steps can you please help me out

    • @devopsvijay
      @devopsvijay  Рік тому

      can you please paste the error, i will try to check.
      Sorry for the late reply

  • @prasadgaming7574
    @prasadgaming7574 5 місяців тому

    Thank you

  • @KuldeepSingh-uo9yf
    @KuldeepSingh-uo9yf Рік тому

    not connected with my jenkins and followd your said steps

    • @devopsvijay
      @devopsvijay  Рік тому

      Can you please provide the complete error for analysis, so that i can go through and try answering it.
      If you are still facing issue, sorry for the delay in reply

  • @ravikumarb3895
    @ravikumarb3895 7 місяців тому

    Hi vijay .... I do same in all steps in practical session the error will occurs authentication failed . i do same all steps by in your video same process

    • @devopsvijay
      @devopsvijay  7 місяців тому

      you might be missing some steps like:
      Couple of things might go wrong in this rejection
      Extra space while pasting private key in jenkins creds
      Private key file and authorized key file permission
      Make sure these 2 files are kept under correct user and correct location.

  • @crazy_life05
    @crazy_life05 Рік тому

    It showing 'ssh connection failed with Ioexception;' why bro?

  • @tusharanand4059
    @tusharanand4059 Рік тому

    Mate, why are you using private IP as hostname ?

    • @devopsvijay
      @devopsvijay  Рік тому

      Because i have complete setup inside same vpc.
      You can use any ip. Only thing that's needed connectivity on port 22

  • @mr_zeeshu110
    @mr_zeeshu110 Рік тому

    jenkins node connection error : Agent JVM has terminated. Exit code=1 Launch failed - cleaning up connection [SSH] Connection closed

  • @maheshnarayantripathi4868
    @maheshnarayantripathi4868 Рік тому

    Hi Sir How to solve mulitiple SSH private key to Jenkins? If i have multiple server.?

    • @devopsvijay
      @devopsvijay  Рік тому

      You can do it using manage jenkins and then credentials

  • @We_aree_Stardust
    @We_aree_Stardust Місяць тому

    What is ec2 box in aws

  • @yoganandatc3906
    @yoganandatc3906 Рік тому +1

    Bro, connection failed ....after trying many times...

    • @devopsvijay
      @devopsvijay  Рік тому

      Please paste the error in comment i will try to help

    • @devopsvijay
      @devopsvijay  Рік тому

      There could be couple of reason of authentication failed.
      1 . Make sure chmod permission of authorized_keys is correct. Where you have pasted public key.
      2. Private key present in jenkins. There should be no extra line while pasting.

  • @veeraiahmadamanchi4723
    @veeraiahmadamanchi4723 5 місяців тому

    Host name didn't worked for me i tried using the public ip it connected

    • @devopsvijay
      @devopsvijay  5 місяців тому

      Please paste the error. I will try to check

  • @Meghana-x1q
    @Meghana-x1q 4 місяці тому

    hello , my doubt is , generated ssh keys in agent server and add private key in jenkins , but where to add public ? in master server or agent server? anyone please give reponse

    • @devopsvijay
      @devopsvijay  4 місяці тому

      Agent server.

    • @magicrooster9491
      @magicrooster9491 2 місяці тому

      @@devopsvijay bro then how to ssh between master and slave? we need to create public and private key on maste? then paste public key on slave,paste private key on jenkin's console right?

  • @DeepikaS-z9i
    @DeepikaS-z9i 9 місяців тому

    Authentication failed

  • @parasrajput3538
    @parasrajput3538 Рік тому

    is it on gcp ?

  • @We_aree_Stardust
    @We_aree_Stardust Місяць тому

    How how to create

    • @devopsvijay
      @devopsvijay  Місяць тому

      Go to aws and ui will guide you to create EC2 MACHINE

  • @kishoregowrish1373
    @kishoregowrish1373 Рік тому +1

    Authentication failed after trying many times

    • @devopsvijay
      @devopsvijay  Рік тому

      Please paste the error in comment . I will look into that and try to help.
      There could be couple of reason of authentication failed.
      1 . Make sure chmod permission of authorized_keys is correct. Where you have pasted public key.
      2. Private key present in jenkins. There should be no extra line while pasting.

    • @DeviL-yw6ud
      @DeviL-yw6ud Рік тому +1

      My side not any authorisation key file

    • @DeviL-yw6ud
      @DeviL-yw6ud Рік тому +1

      @@devopsvijay how to make authorisation key file

    • @devopsvijay
      @devopsvijay  Рік тому

      @@DeviL-yw6ud use ssh-keygen command in linux to create authorisation private and public key file.
      and for authorized_keys file Fire command
      touch authorized_keys inside .ssh folder
      make sure to follow these permission to files:
      .ssh directory: 700 (drwx------)
      public key (.pub file): 644 (-rw-r--r--)
      private key (id_rsa): 600 (-rw-------)

    • @devopsvijay
      @devopsvijay  Рік тому

      chmod 644 /home/$USER/.ssh/authorized_keys

  • @jaybhalani5431
    @jaybhalani5431 8 місяців тому +1

    bhai in ~/.ssh/ i am not getting authorized_key file

  • @qwee8383
    @qwee8383 Рік тому

    dosent work

  • @hariomdoorwar5693
    @hariomdoorwar5693 Рік тому +1

    getting this error
    No Known Hosts file was found at /var/lib/jenkins/.ssh/known_hosts. Please ensure one is created at this path and that Jenkins can read it.

    • @devopsvijay
      @devopsvijay  Рік тому

      There might be a permission issue on your server due to which it is not able to create those files automatically.
      You can create manually and give proper permission to file and folder and see if that works.