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

variables in HostName not working #56

Closed
eiginn opened this issue Sep 8, 2015 · 3 comments · Fixed by #64
Closed

variables in HostName not working #56

eiginn opened this issue Sep 8, 2015 · 3 comments · Fixed by #64
Assignees
Labels

Comments

@eiginn
Copy link

eiginn commented Sep 8, 2015

May be doing something wrong here but %h does not appear to be working for HostName directive.
here is a simplified version of the conf and debug output. This is with the go version

$ assh -D proxy somehost401
DEBU[0000] Loading config file '/home/eiginn/.ssh/assh.yml' 
INFO[0000] Host somehost401                                   
INFO[0000]   AddressFamily inet                         
INFO[0000]   ForwardAgent no                            
INFO[0000]   HostName %h.some.zone                       
INFO[0000]   IdentitiesOnly yes
INFO[0000]   IdentityFile ~/.ssh/id_rsa
INFO[0000]   Port 22                                    
INFO[0000]   PubkeyAuthentication yes                   
INFO[0000]   ServerAliveCountMax 6                      
INFO[0000]   TCPKeepAlive yes                           
INFO[0000]   User eiginn
DEBU[0000] Writing SSH config file to "/home/eiginn/.ssh/config" 
DEBU[0000] Connecting without gateway                   
DEBU[0000] Connecting to %h.some.zone:22                 
FATA[0000] Proxy error: dial tcp: missing brackets in address %h.some.zone:22 



assh.yml

hosts:

  template:
    User: eiginn
    AddressFamily: inet
    PubkeyAuthentication: yes
    ForwardAgent: yes
    IdentityFile: ~/.ssh/id_rsa

  "somehost[0-7]*":
    HostName: "%h.some.zone"
    Inherits:
      - template


defaults:
  Port: 22
  ForwardAgent: no
  TCPKeepAlive: yes
  ServerAliveInterval: 15
  ServerAliveCountMax: 6
  IdentitiesOnly: yes
@moul
Copy link
Owner

moul commented Sep 9, 2015

Which result to you expect ?

ssh somehost401 -> somehost401.some.zone, right ?

@moul moul added the Bug label Sep 9, 2015
@moul moul self-assigned this Sep 9, 2015
@eiginn
Copy link
Author

eiginn commented Sep 9, 2015

yeah.
The relevant normal ssh conf:

Host somehost*
    IdentityFile ~/.ssh/id_rsa
    User eiginn
    ForwardAgent yes
    Hostname %h.some.zone
    AddressFamily inet

Host *
    ForwardAgent no
    TCPKeepAlive yes
    ServerAliveInterval 15
    ServerAliveCountMax 6
    IdentitiesOnly yes

@moul
Copy link
Owner

moul commented Sep 9, 2015

Ok got it :)

@moul moul mentioned this issue Sep 11, 2015
@moul moul closed this as completed in #64 Sep 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants