diff options
author | Andrew Cady <d@cryptonomic.net> | 2021-10-22 15:22:37 -0400 |
---|---|---|
committer | Andrew Cady <d@cryptonomic.net> | 2021-10-23 11:17:15 -0400 |
commit | a19dce5c18f6d6370b58aa3b9dd26550a589fc8c (patch) | |
tree | b8625d617d8ad85e0715b36400411f53d9ad1a75 /Makefile |
Minimal Git/SSH Rhizome
Requires Sudo access to configure OpenSSH.
It would be possible to run OpenSSH on a non-default port and not
require root access. That is not implemented.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..bd63693 --- /dev/null +++ b/Makefile | |||
@@ -0,0 +1,24 @@ | |||
1 | ifeq ($(shell id -u),0) | ||
2 | SUDO = | ||
3 | else | ||
4 | SUDO = sudo | ||
5 | endif | ||
6 | |||
7 | ROOT_INSTALL = $(SUDO) install | ||
8 | |||
9 | USER != echo "$${SUDO_USER:-$$(id -un)}" | ||
10 | |||
11 | SSH_CONFIG_DIR = /etc/ssh | ||
12 | SSHD_CONFIG_DIR = $(SSH_CONFIG_DIR)/sshd_config.d | ||
13 | SSH_LIB_DIR = /usr/lib/ssh | ||
14 | USER_SSH_CONFIG_DIR = ~$(USER)/.ssh | ||
15 | |||
16 | .PHONY: install | ||
17 | install: | ||
18 | install -t $(USER_SSH_CONFIG_DIR) AnonymousAccessCommand | ||
19 | $(ROOT_INSTALL) -d "$(SSH_CONFIG_DIR)" "$(SSHD_CONFIG_DIR)" "$(SSH_LIB_DIR)" || true | ||
20 | $(ROOT_INSTALL) -m0644 -t "$(SSHD_CONFIG_DIR)" anonymous-access.conf || true | ||
21 | $(ROOT_INSTALL) -t "$(SSH_LIB_DIR)" AuthorizedKeysCommand || true | ||
22 | [ -e "$(SSH_LIB_DIR)"/AuthorizedKeysCommand ] || $(SUDO) ln -s -t /etc/ssh "$(SSH_LIB_DIR)"/AuthorizedKeysCommand | ||
23 | |||
24 | include tests.makefile | ||