From f857fa43f02a0046f1bbcfc613e1cb96d1f072ba Mon Sep 17 00:00:00 2001 From: ville rantanen Date: Mon, 28 Mar 2022 21:40:35 +0300 Subject: [PATCH] add common group for data --- build/run.sh | 4 +++- docker-compose.yaml | 1 + example-env | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build/run.sh b/build/run.sh index 31dce36..afef2ad 100755 --- a/build/run.sh +++ b/build/run.sh @@ -6,6 +6,7 @@ basedir=/var/ssh-box/ test -f "$basedir"/ssh-cache/ssh_host_rsa_key || { ssh-keygen -A grep -v -e AuthorizedKeys -e PermitEmptyPasswords -e PasswordAuthentication \ + -e Subsystem \ /etc/ssh/sshd_config > /etc/ssh/sshd_config.tmp mv /etc/ssh/sshd_config.tmp /etc/ssh/sshd_config cat <> /etc/ssh/sshd_config @@ -14,6 +15,7 @@ AuthorizedKeysCommand /usr/local/sbin/get_pub_keys.sh AuthorizedKeysCommandUser root PermitEmptyPasswords no PasswordAuthentication no +Subsystem sftp /usr/lib/ssh/sftp-server -u 002 EOF rsync -va /etc/ssh/ "$basedir"/ssh-cache/ } @@ -27,7 +29,7 @@ chmod 0600 /etc/ssh/*key if getent group box; then echo Group already added else - groupadd -g 997 box + groupadd -g $GRP box fi chown root:root /home diff --git a/docker-compose.yaml b/docker-compose.yaml index 605c3ca..d5cedb2 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -13,6 +13,7 @@ services: environment: - USR=${USR} - NAME=${NAME} + - GRP=${GRP} restart: unless-stopped diff --git a/example-env b/example-env index df58c56..11e521c 100644 --- a/example-env +++ b/example-env @@ -1,3 +1,4 @@ USR=1000 +GRP=1000 EXPOSE=22222 NAME=BOX NAME