summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2013-05-02 17:36:28 +0200
committerJan Pokorný <jpokorny@redhat.com>2013-05-02 17:38:37 +0200
commit63dbf9692a7898957f3f47d58589cc40bbc03741 (patch)
tree24ede58ba9bb3df1375e7cdcf8f6fca374fe2503 /scripts
parent0695d4dc0a4dae3db57908fa2f45ef40aa078b2b (diff)
downloaddotfiles-63dbf9692a7898957f3f47d58589cc40bbc03741.tar.gz
dotfiles-63dbf9692a7898957f3f47d58589cc40bbc03741.tar.xz
dotfiles-63dbf9692a7898957f3f47d58589cc40bbc03741.zip
SSH config: better fingerprints handling for Fedora
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/firstrun/02-ssl-common22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/firstrun/02-ssl-common b/scripts/firstrun/02-ssl-common
index 70be8cf..e29f875 100644
--- a/scripts/firstrun/02-ssl-common
+++ b/scripts/firstrun/02-ssl-common
@@ -1 +1,23 @@
+# fedora setup
+
+local host
+local found
+
wget https://admin.fedoraproject.org/ssh_known_hosts -O ~/.ssh/fedora-known_hosts
+while read host; do
+ found=$(grep $(dig +short "${host}") ~/.ssh/fedora-known_hosts)
+ if test -n "${found}"; then
+ chmod u+w ~/.ssh/config
+ cat >>~/.ssh/config <<EOF
+
+Host $host
+ HostKeyAlias $(echo "${found}" | cut -d, -f1)
+ IdentityFile ~/.ssh/fedora-id_rsa
+ UserKnownHostsFile /dev/null
+ GlobalKnownHostsFile ~/.ssh/fedora-known_hosts
+EOF
+ chmod u-w ~/.ssh/config
+ fi
+done <<-EOFOUT
+ fedorapeople.org
+EOFOUT