Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing ssh config doesn't work with Include statements in it #118

Open
Erokos opened this issue Jan 29, 2025 · 0 comments
Open

Parsing ssh config doesn't work with Include statements in it #118

Erokos opened this issue Jan 29, 2025 · 0 comments

Comments

@Erokos
Copy link

Erokos commented Jan 29, 2025

Hi,

I'm trying to get the sshs (version 4.5.1) to work with my ~/.ssh/config file that includes multiple other configs such as ~/.ssh/config.personal-projects and ~/.ssh/config.work but whatever I tried it just outputs the following error:

Error: Failed to parse SSH configuration file: SshConfig(InvalidInclude(InvalidIncludeError { line: "", details: HostsInsideHostBlock }))

My main file, ~/.ssh/config looked like this originally:

Host *
  ServerAliveInterval 240
  TCPKeepAlive yes
  StrictHostKeyChecking no
  UserKnownHostsFile /dev/null

Include ~/.ssh/config.personal-projects
Include ~/.ssh/config.work

some other specific servers here...

my ~/.ssh/config.work:

Host work-prod-*
    IdentityFile ~/work-repos/security-keys/vault/dec/work-prod
    User ubuntu
    ProxyCommand ssh work-bastion -W %h:%p

Host work-test-*
    IdentityFile ~/work-repos/security-keys/vault/dec/work-test
    User ubuntu
    ProxyCommand ssh work-bastion -W %h:%p

Host integrations* observability* 
    IdentityFile ~/.ssh/work-prod
    User ubuntu

Host work-bastion
    Hostname <REDACTED>
    IdentityFile ~/work-repos/security-keys/vault/dec/work-test
    User ubuntu
    ForwardAgent yes

Host work-prod-master
    Hostname <REDACTED>

Host work-test-master
    Hostname <REDACTED>

Host work-prod-integrations
    Hostname <REDACTED>

Host observability
    Hostname <REDACTED>
```

This setup works when I try regular ssh, e.g. `ssh work-prod-master` but I got the above mentioned error when using sshs.

I then tried moving the all the patterns, such as work-prod-*, to the main config file but no luck. It still works when using the ssh command but the tui outputs the same error. Can you please tell me what am I doing wrong as I really like sshs and would like to use it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant