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

Unable to parse ssh_config without blank lines between Host directives #34

Open
bjeanes opened this issue Dec 18, 2024 · 1 comment
Open

Comments

@bjeanes
Copy link

bjeanes commented Dec 18, 2024

Screenshot 2024-12-19 at 8 30 36 am

This appears to be derived from these directives towards the end of my .ssh/config (full file below):

Host tumtum
  HostName 10.144.119.0
Host tumtum 10.144.119.0 100.87.76.44 10.10.10.46
  ForwardAgent yes

It seems to be offering all 4 Host words as options, though incorrectly attributing the HostName from the tumtum to all 4 in the table view (but the preview is corect).


My full .ssh/config:

Include ~/.orbstack/ssh/config ~/.ssh/config.d/*

Host *
  SetEnv GIT_AUTHOR_EMAIL="[email protected]" GIT_AUTHOR_NAME="Bo Jeanes"
  IdentityAgent '/Users/bjeanes/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock'
Host bandersnatch
  HostName 10.144.79.92
Host bandersnatch 10.144.79.92
  ForwardAgent yes
Host borogrove
  HostName 10.144.230.45
Host borogrove 10.144.230.45
  ForwardAgent yes
Host hass homeassistant home-assistant
  HostName 10.144.245.56
Host hass homeassistant home-assistant 10.144.245.56 100.80.108.14 10.10.10.73
  ForwardAgent yes
Host jabberwocky
  HostName 10.144.6.239
Host jabberwocky 10.144.6.239
  ForwardAgent yes
Host nas
  HostName 10.144.70.159
Host nas 10.144.70.159 100.120.117.10 10.10.10.10
  ForwardAgent yes
Host tumtum
  HostName 10.144.119.0
Host tumtum 10.144.119.0 100.87.76.44 10.10.10.46
  ForwardAgent yes

Host *
  ForwardAgent no
  AddKeysToAgent confirm 1h
  Compression no
  ServerAliveInterval 0
  ServerAliveCountMax 3
  HashKnownHosts no
  UserKnownHostsFile ~/.ssh/known_hosts
  ControlMaster no
  ControlPath ~/.ssh/master-%r@%n:%p
  ControlPersist no
  • ~/.ssh/config.d/ is empty on this machine
  • ~/.orbstack/ssh/config is auto-generated:
    # AUTO-GENERATED BY ORBSTACK. DO NOT EDIT.
    # To make changes, add or override hosts at the top of ~/.ssh/config
    
    Host orb
      Hostname 127.0.0.1
      Port 32222
      # SSH user syntax:
      #   <container>@orb to connect to <container> as the default user (matching your macOS user)
      #   <user>@<container>@orb to connect to <container> as <user>
      # Examples:
      #   ubuntu@orb: container "ubuntu", user matching your macOS user
      #   root@fedora@orb: container "fedora", user "root"
      User default
      # replace or symlink ~/.orbstack/ssh/id_ed25519 file to change the key
      IdentityFile ~/.orbstack/ssh/id_ed25519
      # only use this key
      IdentitiesOnly yes
      ProxyCommand '/Applications/OrbStack.app/Contents/Frameworks/OrbStack Helper.app/Contents/MacOS/OrbStack Helper' ssh-proxy-fdpass 501
      ProxyUseFdpass yes
@bjeanes
Copy link
Author

bjeanes commented Dec 18, 2024

If I put blank lines between the hostnames it has more success parsing them out, but the table mapping Host to HostName is still incorrect:

Screenshot 2024-12-19 at 8 35 25 am

Note: I cannot put blank lines between these entries normally because this file is generated (by Home Manager / Nix) I found a workaround

@bjeanes bjeanes changed the title Only offering the last non-* Host directive as options Unable to parse ssh_config without blank lines between Host directives Dec 18, 2024
bjeanes added a commit to bjeanes/dotfiles that referenced this issue Dec 18, 2024
Although, this isn't actually presenting options well as generated by
Home Manager, due to there not being an empty line between outputted
Host entries.

sunlei/zsh-ssh#34
bjeanes added a commit to bjeanes/dotfiles that referenced this issue Dec 18, 2024
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