Skip to content

[v17] Improve tsh ssh error messages#60226

Merged
rosstimothy merged 1 commit intobranch/v17from
tross/backport-60099/v17
Oct 14, 2025
Merged

[v17] Improve tsh ssh error messages#60226
rosstimothy merged 1 commit intobranch/v17from
tross/backport-60099/v17

Conversation

@rosstimothy
Copy link
Copy Markdown
Contributor

Backport #60099 to branch/v17

changelog: Updated error messages displayed by tsh ssh when access to hosts is denied and when attempting to connect to a host that is offline or not enrolled in the cluster.

Fixes #60055 and
#53267.

Errors emitted when access is denied or hosts are missing from
the inventory have been updated to be clearer to end users.

The current error when connecting to a host that does not exist

```bash
$ tsh ssh tim@fake-host
ERROR: failed connecting to host fake-host:0: failed to receive cluster details response
failed to dial target host
direct dialing to nodes not found in inventory is not supported
```

has been updated to remove ancillary details that have zero meaning to anyone
other than a Teleport developer and better clarify the host does not exist.

```
$ tsh ssh tim@fake-host
ERROR: failed connecting to host fake-host: target host fake-host is offline or does not exist
```

The access denied error

```
$ tsh ssh tim@server01 uptime
ERROR: access denied to tim connecting to server01:0
```

has had a relatively minor and possibly unnoticed
change to omit the port from the dial target.

```
$ tsh ssh tim@server01 uptime
ERROR: access denied to tim connecting to server01
```

fix: use net.SplitHostPort instead of strings.Cut
@rosstimothy rosstimothy marked this pull request as ready for review October 14, 2025 17:41
@github-actions github-actions bot requested a review from espadolini October 14, 2025 17:41
@github-actions github-actions bot requested a review from zmb3 October 14, 2025 17:41
@rosstimothy rosstimothy added this pull request to the merge queue Oct 14, 2025
Merged via the queue into branch/v17 with commit 95c552b Oct 14, 2025
46 checks passed
@rosstimothy rosstimothy deleted the tross/backport-60099/v17 branch October 14, 2025 20:18
@fheinecke fheinecke mentioned this pull request Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants