1 Answer
- Newest
- Most votes
- Most comments
1
Hello,
Please try this solution.
Step 1: Add SSH Credentials in Jenkins
Go to Credentials Management:
- Navigate to Manage Jenkins > Manage Credentials.
Add New Credentials:
- Select the domain where you want to add the credentials (typically (global)).
- Click on Add Credentials.
Fill in the Credential Details:
- Kind: Select Username with password.
- Username: Enter the SSH username for the agent node.
- Password: Enter the corresponding password.
- ID: Leave this blank to let Jenkins generate an ID.
- Description: Add a description to identify the credentials.
- Click OK.
Step 2: Configure the Jenkins Node
Add a New Node:
- Go to Manage Jenkins > Manage Nodes and Clouds > New Node.
Configure Node Settings:
- Name: Enter a name for your node, e.g., MyAgentNode.
- Select Permanent Agent and click OK.
Node Details:
- Remote root directory: Enter the path where Jenkins will store files on the agent, e.g., /home/jenkins.
- Number of Executors: Enter the number of executors (typically 1).
- Labels: Add any labels you need to categorize the node.
- Usage: Select Use this node as much as possible or other appropriate option.
Launch Method:
- Launch method: Select Launch agents via SSH.
- Host: Enter the IP address or hostname of the agent node.
- Credentials: Select the SSH credentials you added earlier.
- Host Key Verification Strategy: Select Manually trusted key verification Strategy.
Save:
- Click Save.
Step 3: Verify and Troubleshoot
Check SSH Access:
- Manually test SSH access from the Jenkins server to the agent node using the provided credentials.
ssh username@172.31.35.194
Relevant content
- AWS OFFICIALUpdated 3 years ago

Hai, Thanks for your replay.
As u said I tired again with the same rules then also I am getting same error.
Jenkins server
Agent server
Credentials images
New Node images
Here in root directory I created in ubuntu like ---- /home/ubuntu/app (This is my root directory in agent server)
**Node credentials **
After save that node, I got same error.
Error message
SSHLauncher{host='172.31.19.146', port=22, credentialsId='6c219c4e-4566-4cda-a602-85997f19292f', jvmOptions='', javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=60, maxNumRetries=10, retryWaitTime=15, sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.ManuallyTrustedKeyVerificationStrategy, tcpNoDelay=true, trackCredentials=true} [07/18/24 15:58:49] [SSH] Opening SSH connection to 172.31.19.146:22. [07/18/24 15:58:49] [SSH] SSH host key matches key seen previously for this host. Connection will be allowed. [07/18/24 15:58:49] [SSH] Authe