]> git.madduck.net Git - etc/ssh.git/blob - .ssh/Makefile

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

remove StrictHostKeyChecking hacks
[etc/ssh.git] / .ssh / Makefile
1 all: known_hosts authorized_keys config
2         @chmod -R og= .
3 .PHONY: all
4
5 known_hosts: $(wildcard known_hosts.d/*)
6         touch $@
7         for f in $^; do \
8           echo "### from $$f:"; \
9           cat $$f; \
10           echo; \
11         done > $@
12
13 authorized_keys: $(wildcard authorized_keys.d/*)
14         touch $@
15         for f in $^; do \
16           echo "### from $$f:"; \
17           cat $$f; \
18           echo; \
19         done > $@
20
21 ifeq ($(strip $(wildcard config.local)),)
22 LOCAL_CONFIG=/dev/null
23 else
24 LOCAL_CONFIG=config.local
25 endif
26
27 SSH_VERSION = $(shell ssh -V 2>&1)
28 config: $(LOCAL_CONFIG) config.in
29         cat $^ > $@
30         case "$(SSH_VERSION)" in \
31           (OpenSSH_6.[012345678]*) \
32             sed -ri -e 's,^.+\bCanonical.+$$,##UNSUPPORTED##&,' \
33                     -e 's,^.+\bIgnoreUnknown\b.+$$,##UNSUPPORTED##&,' \
34                     -e 's,^.+\bUpdateHostKeys\b.+$$,##UNSUPPORTED##&,' \
35                     -e 's,^Match host ,Host ,' \
36                     $@ \
37             ;; \
38           (OpenSSH_6.[0123]*) \
39             sed -ri -e 's,^.+\bCanonical.+$$,##UNSUPPORTED##&,' \
40                     -e 's,^.+\bIgnoreUnknown\b.+$$,##UNSUPPORTED##&,' \
41                     $@ \
42             ;; \
43           (OpenSSH_5.[012345]*) \
44             sed -ri -e 's,^.+\bControlPersist\b.+$$,##UNSUPPORTED##&,' \
45                     -e 's,^.+\bIPQoS\b.+$$,##UNSUPPORTED##&,' \
46                     -e 's,^.+\bCanonical.+$$,##UNSUPPORTED##&,' \
47                     $@ \
48             ;; \
49           (OpenSSH_4.7*) \
50             sed -ri -e 's,^.+\bVisualHostKey\b.+$$,##UNSUPPORTED##&,' \
51                     -e 's,^.+\bControlPersist\b.+$$,##UNSUPPORTED##&,' \
52                     -e 's,^.+\bIPQoS\b.+$$,##UNSUPPORTED##&,' \
53                     -e 's,^.+\bCanonical.+$$,##UNSUPPORTED##&,' \
54                     $@ \
55             ;; \
56           (OpenSSH_4.3*) \
57             sed -ri -e 's,^.+\bExitOnForwardFailure\b.+$$,##UNSUPPORTED##&,' \
58                     -e 's,^.+\bMACs\b.+$$,##UNSUPPORTED##&,' \
59                     -e 's,^(.+ControlPath ~/.var/ssh/ssh_control_)%l_(.+),\1\2,' \
60                     -e 's,^.+\bVisualHostKey\b.+$$,##UNSUPPORTED##&,' \
61                     -e 's,^.+\bControlPersist\b.+$$,##UNSUPPORTED##&,' \
62                     -e 's,^.+\bIPQoS\b.+$$,##UNSUPPORTED##&,' \
63                     -e 's,^.+\bCanonical.+$$,##UNSUPPORTED##&,' \
64                     $@ \
65             ;; \
66           (3.9*) \
67             sed -ri -e 's,^.+\bExitOnForwardFailure\b.+$$,##UNSUPPORTED##&,' \
68                     -e 's,^.+\bMACs\b.+$$,##UNSUPPORTED##&,' \
69                     -e 's,^.+\bHashKnownHosts\b.+$$,##UNSUPPORTED##&,' \
70                     -e 's,^.+\bControl(Master|Path|Persist)\b.+$$,##UNSUPPORTED##&,' \
71                     -e 's,^.+\bIPQoS\b.+$$,##UNSUPPORTED##&,' \
72                     -e 's,^.+\bCanonical.+$$,##UNSUPPORTED##&,' \
73                     $@ \
74             ;; \
75         esac; \
76         case "$$HOSTNAME" in \
77           (fishbowl) \
78             sed -i -re '/^Host fishbowl/,/^[[:space:]]*ProxyCommand/s/ProxyCommand.*/Host localhost/' $@; \
79         esac