Need help with Jenkins Lab: install-packages job failing with SSH Permission Denied (ststor01)

Hi Everyone,

I am working on the Jenkins lab where I need to configure a parameterized job to install packages on the storage server (ststor01). Here is the scenario and where I am getting stuck:

Task Requirements:

  1. Log into Jenkins UI as admin / Adm!n321.
  2. Create a new Freestyle job named install-packages.
  3. Add a String Parameter named PACKAGE (e.g., default vim-enhanced).
  4. Configure an Execute shell build step to install the $PACKAGE on the storage server (ststor01 / Stratos Datacenter).
  5. Build the job with PACKAGE=vim-enhanced to verify installation.

Current Setup & Steps Taken:

In the Jenkins job Execute shell step, I configured:

ssh -o StrictHostKeyChecking=no natasha@ststor01 "sudo yum install -y $PACKAGE"

When I trigger Build with Parameters, the build fails with the following console output:

`PlaintextStarted by user admin
Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/install-packages
[install-packages] $ /bin/sh -xe /tmp/jenkins951156721613744011.sh

  • ssh -o StrictHostKeyChecking=no natasha@ststor01 sudo yum install -y vim-enhanced
    Permission denied, please try again.
    Permission denied, please try again.
    natasha@ststor01: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
    Build step ‘Execute shell’ marked build as failure
    Finished: FAILURE`

Troubleshooting Attempted on jumphost:

  1. Attempted to generate/copy SSH keys as jenkins user:
  • Tried switching to jenkins via sudo su - jenkins and sudo su -s /bin/bash jenkins.
  • Got error: su: user jenkins does not exist or the user entry does not contain all the required fields.
  • Tried sudo -u jenkins: sudo: unknown user: jenkins.
  1. Checked SSH keys on jumphost (thor user):
  • Listed keys in thor’s directory: /home/thor/.ssh contains valid id_rsa and id_rsa.pub key pairs.
  • /var/lib/jenkins/.ssh directory does not exist.

Core Questions / What I Need Help With:

  1. How should passwordless SSH be configured between the Jenkins build runner and ststor01 in this specific lab environment?
  2. Where is the valid SSH key stored that Jenkins is supposed to use to connect to natasha@ststor01 or ststor01?
  3. What is the exact Execute shell script command expected by the lab validator for the install-packages job?

Any guidance on resolving this SSH key / permission issue would be greatly appreciated!

Could you please share the lab/course name?
A link to the lab would be helpful as well.

KK Engineer: Jenkins Lab Level 01: Problem no 05
https://engineer.kodekloud.com/task?id=64688fb8c1ff5e7e05478f3f&status=start