summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@cryptonomic.net>2021-10-24 19:25:49 -0400
committerAndrew Cady <d@cryptonomic.net>2021-10-24 19:28:01 -0400
commit43fe9eabcba5917c6a1df6dd8cecfda17e0ba6d8 (patch)
tree8a9b838375014928afd6e36c34c0abfa54a0a1f5
parent53baccbd52f940b01e8b10006292d255193d7a2c (diff)
generate ~/.ssh/id_ed25519 as needed
generate ~/.ssh/AnonymousAccessCommand whether or not privileged
-rw-r--r--EndoForge/Makefile14
1 files changed, 10 insertions, 4 deletions
diff --git a/EndoForge/Makefile b/EndoForge/Makefile
index 0f662d6..6739edd 100644
--- a/EndoForge/Makefile
+++ b/EndoForge/Makefile
@@ -25,7 +25,7 @@ USER_SSH_CONFIG_DIR = ~$(USER)/.ssh
25 25
26BROWSER != 2>/dev/null which xdg-open || which w3m || which links || which elinks 26BROWSER != 2>/dev/null which xdg-open || which w3m || which links || which elinks
27 27
28.PHONY: install install-user install-root shared doc test 28.PHONY: install install-user install-user-config install-root shared doc test
29 29
30doc: README.html 30doc: README.html
31 $(BROWSER) $< 31 $(BROWSER) $<
@@ -46,11 +46,17 @@ sed \
46 -e 's?PidFile=$$?&$(HOME)/.ssh/sshd.pid?' 46 -e 's?PidFile=$$?&$(HOME)/.ssh/sshd.pid?'
47endef 47endef
48 48
49install: $(if $(HAVE_ROOT), install-root, install-user) 49install: $(if $(HAVE_ROOT), install-root, install-user)
50 50
51install-user: 51install-user-config:
52 $(INSTALL) -d ~/.ssh 52 $(INSTALL) -d ~/.ssh
53 $(INSTALL) -t ~/.ssh $(SRC)/AnonymousAccessCommand 53 $(INSTALL) -t ~/.ssh $(SRC)/AnonymousAccessCommand
54
55
56~/.ssh/id_ed25519:
57 ssh-keygen -t ed25519 -P '' -f $@
58
59install-user: install-user-config ~/.ssh/id_ed25519
54 $(EDIT_SSHD) < $(SRC)/sshd_config > ~/.ssh/sshd_config.tmp 60 $(EDIT_SSHD) < $(SRC)/sshd_config > ~/.ssh/sshd_config.tmp
55 $(MV) ~/.ssh/sshd_config.tmp ~/.ssh/sshd_config 61 $(MV) ~/.ssh/sshd_config.tmp ~/.ssh/sshd_config
56 $(INSTALL) -m0644 -t ~/.config/systemd/user $(SRC)/sshd.service 62 $(INSTALL) -m0644 -t ~/.config/systemd/user $(SRC)/sshd.service
@@ -58,7 +64,7 @@ install-user:
58 systemctl --user enable sshd 64 systemctl --user enable sshd
59 systemctl --user restart sshd 65 systemctl --user restart sshd
60 66
61install-root: 67install-root: install-user-config
62 $(ROOT_INSTALL) -d "$(SSH_CONFIG_DIR)" "$(SSHD_CONFIG_DIR)" "$(SSH_LIB_DIR)" || true 68 $(ROOT_INSTALL) -d "$(SSH_CONFIG_DIR)" "$(SSHD_CONFIG_DIR)" "$(SSH_LIB_DIR)" || true
63 $(ROOT_INSTALL) -m0644 -t "$(SSHD_CONFIG_DIR)" $(SRC)/anonymous-access.conf || true 69 $(ROOT_INSTALL) -m0644 -t "$(SSHD_CONFIG_DIR)" $(SRC)/anonymous-access.conf || true
64 $(ROOT_INSTALL) -t "$(SSH_LIB_DIR)" $(SRC)/AuthorizedKeysCommand || true 70 $(ROOT_INSTALL) -t "$(SSH_LIB_DIR)" $(SRC)/AuthorizedKeysCommand || true