blob: 20330b99841dfc4636eee0a969798f37c59bdc5d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/bin/bash
# update cache of ssh and https host keys for USB drives
OUTPUT=$HOME/lib/annex/big/skel/usb/lib/host_keys.txt
OUTPUT_OPENSSH=$HOME/lib/annex/big/skel/usb/lib/known_hosts
(
echo -n "Generated by ~/bin/usbpubkeys "
date
echo
echo -n "athena.silentflame.com's SSH key fingerprint: "
# assume that we've already got it in known_hosts locally
ssh -o ControlMaster=no -o ControlPath=/dev/null -v athena /bin/true 2>&1 \
| grep "Server host key:" | cut -d' ' -f 5-6
# don't assume our connection is safe; ssh to ma first
# echo -n "ma.sdf.org's web SSL key SHA1 fingerprint: "
# echo -n | ssh ma openssl s_client -connect ma:443 2>/dev/null | \
# openssl x509 -noout -fingerprint | cut -f2 -d'='
) > $OUTPUT
unix2dos $OUTPUT
ssh-keyscan -t rsa athena.silentflame.com > $OUTPUT_OPENSSH
|