]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
ssh-client: handle /etc/ssh/ssh_config
authorHarald Hoyer <harald@redhat.com>
Fri, 29 Aug 2014 12:06:57 +0000 (14:06 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 29 Aug 2014 13:27:22 +0000 (15:27 +0200)
- disable ProxyCommand
- install the GlobalKnownHostsFile

https://bugzilla.redhat.com/show_bug.cgi?id=1086778

modules.d/95ssh-client/module-setup.sh

index f3ac6e9719c30be2429d0829f6cf9531c23899a8..36bfbc89742068511386c8f4d60fb9342ae259f6 100755 (executable)
@@ -41,7 +41,15 @@ inst_sshenv()
 
     # Copy over root and system-wide ssh configs.
     [[ -f /root/.ssh/config ]] && inst_simple /root/.ssh/config
-    [[ -f /etc/ssh/ssh_config ]] && inst_simple /etc/ssh/ssh_config
+    if [[ -f /etc/ssh/ssh_config ]]; then
+        inst_simple /etc/ssh/ssh_config
+        sed -i -e 's/\(^[[:space:]]*\)ProxyCommand/\1# ProxyCommand/' ${initdir}/etc/ssh/ssh_config
+        while read key val; do
+            [[ key != "GlobalKnownHostsFile" ]] && continue
+            inst_simple "$val"
+            break
+        done < /etc/ssh/ssh_config
+    fi
 
     return 0
 }