TASK Jenkins Install Packages: SSH Issues

hello,

I’m taking the 5 task in Level 1 Jenkins, I have a problem with ssh connection is failed each time i made a connection test, I have created the credentials as the wiki docs: Nautilus (kodekloudhub.github.io)

Can you help me please

thank you


uss the doubts and questions about the Jenkins course on KodeKloud

Do you make correct credentials for storage server?
Can you connect to storage server from jenkins server via ssh from cli?
Is this error repeats even after restart the lab?

Hi bhard

Thanks you for your reply

access to storage server through Ssh from CLI(yes from jumphost and not test yet from jenkins server)

Yes I made the credentials in jenkins GUI

Yes for serveral times it is the same problem :sleepy:

In this thread https://kodekloud.com/community/t/jenkins-install-packages-build-failed/342816/7 users fase the same problem.
But KKE team says that task is ok.
SSH plugin that you using is correct (I use the same). Try to ask kelf from KKE Team.
But if no luck, I can provide you another solutions for this task:
Install sshpass to jenkins server (via cli).
Set “Use secret text(s) of file(s)” option for freestyle job, and make variables for login/pass for ststor01 server.
Next just add shell command to job:
sshpass -p "$PASSWORD" ssh -o "StrictHostKeyChecking no" -tt $USERNAME@ststor01 "echo $PASSWORD | sudo -S yum install -y $PKG"
Where $PASSWORD and $USERNAME - previous variables, and $PKG - parameter for package to install.

This work for me even without SSH plugin in my local lab.

Or make it even easier:
Generage ssh-key for jenkins server and send it to ststor01.
Next, add ‘natasha ALL=(ALL:ALL) ALL’ to /etc/sudoers file on ststor01.
Then with this should work simple command:
ssh -t natasha@ststor01 sudo yum install -y $PKG

hello !!
Thanks you for your help !! it’s done now :slight_smile:


forum_response2