]> 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 12:14:10 +0000 (14:14 +0200)
- disable ProxyCommand
- install the GlobalKnownHostsFile

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

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

index 66e5307d54c5540da08e1c558bfd6e9b0ec962fa..f60e9631c33b3db10f31ee90d7927521dd49fa4d 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
 }