Fix: set the Fedora-specific ssh_config file for augeas

The Host entry in /etc/ssh/ssh_config file on Fedora 25+ is commented
because there is an Include directive and the custom settings have
been moved to a file there.
This leads to a failure when the augeas lens tries to write to that
files. If I read the schema correctly, the lens assumes that the Host
entry is available/uncommented (this it was the case before in Fedora,
and in CentOS and RHEL, and in Debian/Ubuntu, where a customization
is a applied to the upstream default file, which is used as it is now
in Fedora).
This maybe could be an issue of the lens which may not assume that
key, but I'm not sure whether is possible.
In the meantime, use the existing customization file on Fedora,
instead of /etc/ssh/ssh_config.

Change-Id: Iee5c109b1265b54a75f675d26c9fec49c777d298
This commit is contained in:
Luigi Toscano 2017-04-27 15:01:38 +02:00
parent 8ec0c00ae0
commit ffb7f68895
1 changed files with 12 additions and 2 deletions

View File

@ -7,12 +7,22 @@ set -ue
set -o pipefail
echo "Begin: install and configure SSH"
case "$DISTRO_NAME" in
fedora )
# the main config file is empty in F25+
SSH_CONFIG_FILE="/etc/ssh/ssh_config.d/05-redhat.conf"
;;
* )
SSH_CONFIG_FILE="/etc/ssh/ssh_config"
;;
esac
augtool <<EOF
set /files/etc/ssh/sshd_config/GSSAPIAuthentication no
set /files/etc/ssh/sshd_config/UseDNS no
set /files/etc/ssh/sshd_config/PermitTunnel yes
set /files/etc/ssh/ssh_config/Host/StrictHostKeyChecking no
set /files/etc/ssh/ssh_config/Host/GSSAPIAuthentication no
set /files${SSH_CONFIG_FILE}/Host/StrictHostKeyChecking no
set /files${SSH_CONFIG_FILE}/Host/GSSAPIAuthentication no
save
EOF