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:
- Log into Jenkins UI as
admin/Adm!n321. - Create a new Freestyle job named
install-packages. - Add a String Parameter named
PACKAGE(e.g., defaultvim-enhanced). - Configure an Execute shell build step to install the
$PACKAGEon the storage server (ststor01/ Stratos Datacenter). - Build the job with
PACKAGE=vim-enhancedto 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:
- Attempted to generate/copy SSH keys as
jenkinsuser:
- Tried switching to
jenkinsviasudo su - jenkinsandsudo 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.
- Checked SSH keys on
jumphost(thoruser):
- Listed keys in
thor’s directory:/home/thor/.sshcontains validid_rsaandid_rsa.pubkey pairs. -
/var/lib/jenkins/.sshdirectory does not exist.
Core Questions / What I Need Help With:
- How should passwordless SSH be configured between the Jenkins build runner and
ststor01in this specific lab environment? - Where is the valid SSH key stored that Jenkins is supposed to use to connect to
natasha@ststor01orststor01? - What is the exact Execute shell script command expected by the lab validator for the
install-packagesjob?
Any guidance on resolving this SSH key / permission issue would be greatly appreciated!