From 43fe9eabcba5917c6a1df6dd8cecfda17e0ba6d8 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sun, 24 Oct 2021 19:25:49 -0400 Subject: generate ~/.ssh/id_ed25519 as needed generate ~/.ssh/AnonymousAccessCommand whether or not privileged --- EndoForge/Makefile | 14 ++++++++++---- 1 file 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 BROWSER != 2>/dev/null which xdg-open || which w3m || which links || which elinks -.PHONY: install install-user install-root shared doc test +.PHONY: install install-user install-user-config install-root shared doc test doc: README.html $(BROWSER) $< @@ -46,11 +46,17 @@ sed \ -e 's?PidFile=$$?&$(HOME)/.ssh/sshd.pid?' endef -install: $(if $(HAVE_ROOT), install-root, install-user) +install: $(if $(HAVE_ROOT), install-root, install-user) -install-user: +install-user-config: $(INSTALL) -d ~/.ssh $(INSTALL) -t ~/.ssh $(SRC)/AnonymousAccessCommand + + +~/.ssh/id_ed25519: + ssh-keygen -t ed25519 -P '' -f $@ + +install-user: install-user-config ~/.ssh/id_ed25519 $(EDIT_SSHD) < $(SRC)/sshd_config > ~/.ssh/sshd_config.tmp $(MV) ~/.ssh/sshd_config.tmp ~/.ssh/sshd_config $(INSTALL) -m0644 -t ~/.config/systemd/user $(SRC)/sshd.service @@ -58,7 +64,7 @@ install-user: systemctl --user enable sshd systemctl --user restart sshd -install-root: +install-root: install-user-config $(ROOT_INSTALL) -d "$(SSH_CONFIG_DIR)" "$(SSHD_CONFIG_DIR)" "$(SSH_LIB_DIR)" || true $(ROOT_INSTALL) -m0644 -t "$(SSHD_CONFIG_DIR)" $(SRC)/anonymous-access.conf || true $(ROOT_INSTALL) -t "$(SSH_LIB_DIR)" $(SRC)/AuthorizedKeysCommand || true -- cgit v1.2.3