add common group for data
This commit is contained in:
@@ -6,6 +6,7 @@ basedir=/var/ssh-box/
|
|||||||
test -f "$basedir"/ssh-cache/ssh_host_rsa_key || {
|
test -f "$basedir"/ssh-cache/ssh_host_rsa_key || {
|
||||||
ssh-keygen -A
|
ssh-keygen -A
|
||||||
grep -v -e AuthorizedKeys -e PermitEmptyPasswords -e PasswordAuthentication \
|
grep -v -e AuthorizedKeys -e PermitEmptyPasswords -e PasswordAuthentication \
|
||||||
|
-e Subsystem \
|
||||||
/etc/ssh/sshd_config > /etc/ssh/sshd_config.tmp
|
/etc/ssh/sshd_config > /etc/ssh/sshd_config.tmp
|
||||||
mv /etc/ssh/sshd_config.tmp /etc/ssh/sshd_config
|
mv /etc/ssh/sshd_config.tmp /etc/ssh/sshd_config
|
||||||
cat <<EOF >> /etc/ssh/sshd_config
|
cat <<EOF >> /etc/ssh/sshd_config
|
||||||
@@ -14,6 +15,7 @@ AuthorizedKeysCommand /usr/local/sbin/get_pub_keys.sh
|
|||||||
AuthorizedKeysCommandUser root
|
AuthorizedKeysCommandUser root
|
||||||
PermitEmptyPasswords no
|
PermitEmptyPasswords no
|
||||||
PasswordAuthentication no
|
PasswordAuthentication no
|
||||||
|
Subsystem sftp /usr/lib/ssh/sftp-server -u 002
|
||||||
EOF
|
EOF
|
||||||
rsync -va /etc/ssh/ "$basedir"/ssh-cache/
|
rsync -va /etc/ssh/ "$basedir"/ssh-cache/
|
||||||
}
|
}
|
||||||
@@ -27,7 +29,7 @@ chmod 0600 /etc/ssh/*key
|
|||||||
if getent group box; then
|
if getent group box; then
|
||||||
echo Group already added
|
echo Group already added
|
||||||
else
|
else
|
||||||
groupadd -g 997 box
|
groupadd -g $GRP box
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chown root:root /home
|
chown root:root /home
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- USR=${USR}
|
- USR=${USR}
|
||||||
- NAME=${NAME}
|
- NAME=${NAME}
|
||||||
|
- GRP=${GRP}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
USR=1000
|
USR=1000
|
||||||
|
GRP=1000
|
||||||
EXPOSE=22222
|
EXPOSE=22222
|
||||||
NAME=BOX NAME
|
NAME=BOX NAME
|
||||||
|
|||||||
Reference in New Issue
Block a user