Skip to content

Exosphere does not support ssh_config(5) Includes #340

Description

@crpb

Describe the bug
Included configurations from ssh_config are not being honored which doesn't allow for more complex ssh-configurations.
I use this to be able to share certain ssh-configurations for multiple customers with coworkers through an git-repo. This allows additions/changes/removals for hosts by any person that has the respective access. This is done by e.g. Include %d/git/work/ssh_config_support/*.conf which consists of configurations for each customer, test-systems, defaults, etc..
Managing all hosts in a single file or just /etc/ssh_config and ~/.ssh/config would end up in a disaster and people also getting configurations for various things like completion in your shell for hosts they don't even have access to as that also allows the use of multiple repos or just multiple configurations in your ~/.ssh/ or some other path for personal settings like my own VPS or systems at home.

To Reproduce

  1. Create a "passwordless" pubkey that doesn't match the defaults (e.g. ssh -F /etc/ssh/ssh_config -G localhost |grep identity) and place it in authorized_keys.

This will just make sure that those defaults will not match by chance. You could also create a pubkey with an password and add it to your ssh-agent but it doesn't make a difference.

$ mkdir -m 0700 -p ~/.ssh
$ ssh-keygen -t ed25519 -P "" -f ~/.ssh/localhosttest
$ cat ~/.ssh/localhosttest.pub >> ~/.ssh/authorized_keys
  1. Configure ssh_config with Include.
$ echo 'Include %d/.ssh/include' >> ~/.ssh/config
$ echo -e 'Host localhost\nIdentityFile %d/.ssh/localhosttest' >> ~/.ssh/config/include
  1. Test SSH Connection
$ ssh -o StrictHostKeyChecking=accept-new -vvv localhost echo moo |& grep -e 'moo' -e 'identity' -e 'include' -e 'close'
debug3: Started with: ssh -vvv localhost echo moo
debug3: /home/test/.ssh/config line 1: Including file /home/test/.ssh/include depth 0
debug1: Reading configuration data /home/test/.ssh/include
debug1: /home/test/.ssh/include line 1: Applying options for localhost
debug1: identity file /home/test/.ssh/localhosttest type 2
debug1: no identity pubkey loaded from /home/test/.ssh/localhosttest
debug1: Sending command: echo moo
moo
debug2: channel 0: output drain -> closed
debug2: channel 0: input open -> closed
debug2: channel 0: rcvd close
debug3: channel 0: will not send data after close
debug2: channel 0: send_close2
debug2: channel 0: send close for remote id 0
  1. Create exosphere configuration
$ mkdir -p ~/.config/exosphere
$ cat << EOF > ~/.config/exosphere/config.toml
[options]
debug = true
log_level = "DEBUG"

[[hosts]]
name = "localhost"
ip = "localhost"
EOF
  1. Run a disvoery
test@obelix:~$ exosphere host discover localhost
2026-07-10 03:23:33,357 - exosphere.main - INFO - Logging initialized with level: DEBUG
2026-07-10 03:23:33,357 - exosphere.main - WARNING - Debug mode enabled! Logs may flood console!
2026-07-10 03:23:33,358 - exosphere.inventory - DEBUG - Initializing inventory with 1 hosts
2026-07-10 03:23:33,358 - exosphere.inventory - DEBUG - Loading state from cache file /home/test/.local/state/exosphere/exosphere.db
2026-07-10 03:23:33,358 - exosphere.inventory - DEBUG - Current Schema Version: 2
2026-07-10 03:23:33,360 - exosphere.inventory - DEBUG - Host localhost not found in cache, creating new
2026-07-10 03:23:33,361 - exosphere.pipelining - DEBUG - SSH pipelining disabled, not starting reaper thread
⠋ Discovering platform for 'localhost' 0:00:002026-07-10 03:23:33,366 - exosphere.objects - DEBUG - Pinging host localhost at localhost:22
2026-07-10 03:23:33,367 - exosphere.objects - DEBUG - Creating new connection to localhost using localhost:22, (timeout: 10)
2026-07-10 03:23:33,438 - exosphere.objects - ERROR - Ping to host localhost failed: No authentication methods available
2026-07-10 03:23:33,438 - exosphere.objects - DEBUG - Ping failed, will attempt platform detection for better error diagnosis
⠙ Discovering platform for 'localhost' 0:00:002026-07-10 03:23:33,503 - exosphere.setup.detect - ERROR - Unexpected error during OS detection: No authentication methods available
2026-07-10 03:23:33,504 - exosphere.objects - WARNING - Host localhost is offline, skipping discover.
2026-07-10 03:23:33,504 - exosphere.objects - DEBUG - Closed SSH connection to localhost (localhost:22)
╭─ Error ───────────────────────────────────────────╮
│ SSHException: No authentication methods available │
╰───────────────────────────────────────────────────╯
⠙ Discovering platform for 'localhost' 0:00:00
2026-07-10 03:23:33,506 - exosphere.main - DEBUG - Running exit handler for cache lock release
2026-07-10 03:23:33,506 - exosphere.main - DEBUG - Releasing cache lock on exit
2026-07-10 03:23:33,506 - exosphere.main - DEBUG - Running exit handler for connections cleanup
2026-07-10 03:23:33,506 - exosphere.main - DEBUG - Closing all SSH connections on exit
2026-07-10 03:23:33,506 - exosphere.inventory - DEBUG - Closing all SSH connections for 1 hosts
2026-07-10 03:23:33,506 - exosphere.objects - DEBUG - Closed SSH connection to localhost (localhost:22)
2026-07-10 03:23:33,506 - exosphere.objects - DEBUG - Clearing connection object for host localhost

Expected behavior
A successful discovery.

Where Exosphere runs:

  • Platform: Debian Forky/Sid
  • Exosphere Version: 3.0.0

Reference

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreRelevant to exosphere core or shared components (objects, Inventory, logic etc)documentationImprovements or additions to documentation

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions