jenkinsci / jenkinsci/ec2-plugin

[JENKINS-62340] ec2-1.50.3 doesn't clean known_hosts

Open
#1,769 0 comments 0 reactions 0 assignees View on GitHub
component:ec2-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
292
Forks
709
Avg merge
3d 16h
Merged PRs (30d)
4

Description

When Jenkins is connected to the slaves in using the 'Connect by SSH Process' the slaves host key are not removed from the known_hosts  when the slave is deleted. 

It implies we will not be able to recreate a slaves with the same IPs which cause issues when Slaves are dynamically triggered. Currently i have to remove the SSH key verification to make it works.

---
Originally reported by angegar, imported from: ec2-1.50.3 doesn't clean known_hosts


  • assignee: thoulen
  • status: Open
  • priority: Major
  • component(s): ec2-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-06

Raw content of original issue

When Jenkins is connected to the slaves in using the 'Connect by SSH Process' the slaves host key are not removed from the known_hosts  when the slave is deleted. 

It implies we will not be able to recreate a slaves with the same IPs which cause issues when Slaves are dynamically triggered. Currently i have to remove the SSH key verification to make it works.

environment

```
Jenkins 2.236

Option : Connect by SSH Process = true
```

Contributor guide

Open the contributing guide

Research direction

Start with the ec2-plugin path used by the “Connect by SSH Process” option and reproduce deletion of an agent whose host key is in known_hosts. Trace the agent deletion cleanup and verify that recreating an agent with the same IP succeeds with SSH host-key verification enabled; the issue names no files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.