*Short question: How do I get rid of this, without having to modify the
openssh/attributes/default.rb file; ie. from my own cookbook, which
has a “include_recipe
"openssh"” somewhere.*
Because of that, the generated /etc/ssh/ssh_config file contains at least
this:
$ cat /etc/ssh/ssh_config
This file was generated by Chef for host
Do NOT modify this file by hand!
Host *
Ie., there’s at least a “Host *” entry. And the way I have it now, all my
attributes are below that; ie. my ssh_config file reads:
$ cat /etc/ssh/ssh_config
This file was generated by Chef for host
Do NOT modify this file by hand!
Host *
GlobalKnownHostsFile /var/lib/sss/pubconf/known_hosts
PubkeyAuthentication yes
VerifyHostKeyDNS no #VerifyHostKeyDNS:No-SonstIstEsZuLangsam no
HostKeyAlgorithms ssh-rsa,ssh-dss
ProxyCommand /usr/bin/sss_ssh_knownhostsproxy -p %p %h
That’s not quite what I want. I don’t want that “Host *” line there.
I would not have expected, that my “default” settings (eg. proxy_command to
take just one example) is below “Host bar”. As it is not in any Host hash,
I would’ve expected, that the setting would’ve been above all the "Host …"
blocks or maybe in the “Host *” block.
How to do it correctly?
When I move my “default lines” ABOVE all the “Host” lines (
default[‘openssh’][‘client’][‘foo’] and default[‘openssh’][‘client’][‘bar’]),
then the generated ssh_config is good. Don’t know, but that does not feel
right.
*Short question: How do I get rid of this, without having to modify the
openssh/attributes/default.rb file; ie. from my own cookbook, which has a “include_recipe
"openssh"” somewhere.*
Because of that, the generated /etc/ssh/ssh_config file contains at least
this:
$ cat /etc/ssh/ssh_config
This file was generated by Chef for host
Do NOT modify this file by hand!
Host *
Ie., there’s at least a “Host *” entry. And the way I have it now, all my
attributes are below that; ie. my ssh_config file reads:
$ cat /etc/ssh/ssh_config
This file was generated by Chef for host
Do NOT modify this file by hand!
Host *
GlobalKnownHostsFile /var/lib/sss/pubconf/known_hosts
PubkeyAuthentication yes
VerifyHostKeyDNS no #VerifyHostKeyDNS:No-SonstIstEsZuLangsam no
HostKeyAlgorithms ssh-rsa,ssh-dss
ProxyCommand /usr/bin/sss_ssh_knownhostsproxy -p %p %h
That’s not quite what I want. I don’t want that “Host *” line there.
The order of things can matter in Chef, and the way the openssh cookbook
works is pretty simplistic. As far as the /etc/ssh/ssh_config file is
concerned, take a look at how it’s generated:
As you can see, it’s going to take each of the attributes you declare and
write them to the file. It’s logical that they would be listed in the file
in the same order you listed them in your attributes file. So this is one
instance where the order in which you list attributes can matter. It often
doesn’t matter. The cookbook is designed this way so it doesn’t have to
account for every possible configurable item supported by OpenSSH. You just
tell it what you need and it will write it into the file. The advantage is
that the cookbook won’t need an update if, in the future, versions of
OpenSSH are released that add new configurable parameters, so long as they
don’t break compatibility with the formatting of the /etc/ssh/ssh(d)_config
files.
I would not have expected, that my “default” settings (eg. proxy_command to
take just one example) is below “Host bar”. As it is not in any Host
hash, I would’ve expected, that the setting would’ve been above all the
"Host …" blocks or maybe in the “Host *” block.
How to do it correctly?
When I move my “default lines” ABOVE all the “Host” lines (
default[‘openssh’][‘client’][‘foo’] and
default[‘openssh’][‘client’][‘bar’]), then the generated ssh_config is
good. Don’t know, but that does not feel right.
*Short question: How do I get rid of this, without having to modify the
openssh/attributes/default.rb file; ie. from my own cookbook, which has a “include_recipe
"openssh"” somewhere.*
Because of that, the generated /etc/ssh/ssh_config file contains at
least this:
$ cat /etc/ssh/ssh_config
This file was generated by Chef for host
Do NOT modify this file by hand!
Host *
Ie., there’s at least a “Host *” entry. And the way I have it now, all
my attributes are below that; ie. my ssh_config file reads:
$ cat /etc/ssh/ssh_config
This file was generated by Chef for host
Do NOT modify this file by hand!
Host *
GlobalKnownHostsFile /var/lib/sss/pubconf/known_hosts
PubkeyAuthentication yes
VerifyHostKeyDNS no #VerifyHostKeyDNS:No-SonstIstEsZuLangsam no
HostKeyAlgorithms ssh-rsa,ssh-dss
ProxyCommand /usr/bin/sss_ssh_knownhostsproxy -p %p %h
That’s not quite what I want. I don’t want that “Host *” line there.
The order of things can matter in Chef, and the way the openssh cookbook
works is pretty simplistic. As far as the /etc/ssh/ssh_config file is
concerned, take a look at how it’s generated:
https://github.com/chef-cookbooks/openssh/blob/master/templates/default/ssh_config.erb
As you can see, it’s going to take each of the attributes you declare and
write them to the file. It’s logical that they would be listed in the file
in the same order you listed them in your attributes file. So this is one
instance where the order in which you list attributes can matter. It often
doesn’t matter. The cookbook is designed this way so it doesn’t have to
account for every possible configurable item supported by OpenSSH. You just
tell it what you need and it will write it into the file. The advantage is
that the cookbook won’t need an update if, in the future, versions of
OpenSSH are released that add new configurable parameters, so long as they
don’t break compatibility with the formatting of the /etc/ssh/ssh(d)_config
files.
I would not have expected, that my “default” settings (eg. proxy_command to
take just one example) is below “Host bar”. As it is not in any Host
hash, I would’ve expected, that the setting would’ve been above all the
"Host …" blocks or maybe in the “Host *” block.
How to do it correctly?
When I move my “default lines” ABOVE all the “Host” lines (
default[‘openssh’][‘client’][‘foo’] and
default[‘openssh’][‘client’][‘bar’]), then the generated ssh_config is
good. Don’t know, but that does not feel right.
*Short question: How do I get rid of this, without having to modify
the openssh/attributes/default.rb file; ie. from my own cookbook, which has
a “include_recipe “openssh”” somewhere.*
Because of that, the generated /etc/ssh/ssh_config file contains at
least this:
$ cat /etc/ssh/ssh_config
This file was generated by Chef for host
Do NOT modify this file by hand!
Host *
Ie., there’s at least a “Host *” entry. And the way I have it now, all
my attributes are below that; ie. my ssh_config file reads:
$ cat /etc/ssh/ssh_config
This file was generated by Chef for host
Do NOT modify this file by hand!
Host *
GlobalKnownHostsFile /var/lib/sss/pubconf/known_hosts
PubkeyAuthentication yes
VerifyHostKeyDNS no #VerifyHostKeyDNS:No-SonstIstEsZuLangsam no
HostKeyAlgorithms ssh-rsa,ssh-dss
ProxyCommand /usr/bin/sss_ssh_knownhostsproxy -p %p %h
That’s not quite what I want. I don’t want that “Host *” line there.
The attribute will be update before the recipe is evaluated, and it will
update the file accordingly.
What I don’t understand is why you don’t wish a Host * in your
ssh_config.
It is to declare the defaults value for all hosts, until another “Host
something” entry is found which in turn could update settings with
specific values for the “something” pattern.
I’m even unsure keywords before a Host line will be used by the ssh
client.
SHORT QUESTION: HOW DO I GET RID OF THIS, WITHOUT HAVING TO MODIFY THE OPENSSH/ATTRIBUTES/DEFAULT.RB FILE; IE. FROM MY OWN COOKBOOK, WHICH HAS A “INCLUDE_RECIPE “OPENSSH”” SOMEWHERE.
Because of that, the generated /etc/ssh/ssh_config file contains at least this:
$ cat /etc/ssh/ssh_config
This file was generated by Chef for host
Do NOT modify this file by hand!
Host *
Ie., there’s at least a “Host *” entry. And the way I have it now, all my attributes are below that; ie. my ssh_config file reads:
I would not have expected, that my “default” settings (eg. proxy_command to take just one example) is below “Host bar”. As it is not in any Host hash, I would’ve expected, that the setting would’ve been above all the “Host …” blocks or maybe in the “Host *” block.
How to do it correctly?
When I move my “default lines” ABOVE all the “Host” lines (default[‘openssh’][‘client’][‘foo’] and default[‘openssh’][‘client’][‘bar’]), then the generated ssh_config is good. Don’t know, but that does not feel right.
SHORT QUESTION: HOW DO I GET RID OF THIS, WITHOUT HAVING TO MODIFY THE OPENSSH/ATTRIBUTES/DEFAULT.RB FILE; IE. FROM MY OWN COOKBOOK, WHICH HAS A “INCLUDE_RECIPE “OPENSSH”” SOMEWHERE.
Because of that, the generated /etc/ssh/ssh_config file contains at least this:
$ cat /etc/ssh/ssh_config
This file was generated by Chef for host
Do NOT modify this file by hand!
Host *
Ie., there’s at least a “Host *” entry. And the way I have it now, all my attributes are below that; ie. my ssh_config file reads: