diff --git a/Dockerfile b/Dockerfile index c996dc7..a6d0c20 100644 --- a/Dockerfile +++ b/Dockerfile @@ -101,6 +101,7 @@ ENV SBBSEXEC=/opt/sbbs/exec ENV PATH=$PATH:${SBBSEXEC} COPY start.sh ${SBBSEXEC}/ +COPY doorparty.sh ${SBBSEXEC}/ COPY main.cnf /opt/sbbs/ctrl.orig/ COPY sshd_config /opt/sbbs/ctrl.orig/ diff --git a/doorparty.sh b/doorparty.sh new file mode 100755 index 0000000..9d5d728 --- /dev/null +++ b/doorparty.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +GROUP=doorparty +GID=1000 +USERS=${SBBSCTRL}/doorparty-connector.users + +if ! grep -qe ^${GROUP}: /etc/group; then + echo true + groupadd -g ${GID} ${GROUP} +fi + +if [ -r ${USERS} ]; then + cat ${USERS} | while read line; do + user=$(echo ${line}|awk -F: '{print $1}') + if ! grep -qe ^${user}: /etc/passwd; then + echo "+ Adding Door Party User: ${user}" + useradd -c "Door Party User" -g ${GROUP} -MN -s /usr/sbin/nologin ${user} + echo -n $line | chpasswd + fi + done +fi diff --git a/sshd_config b/sshd_config index 6ab97b6..f55f69e 100644 --- a/sshd_config +++ b/sshd_config @@ -42,10 +42,6 @@ PubkeyAuthentication no #AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2 #AuthorizedPrincipalsFile none -AuthorizedKeysCommand /opt/sbbs/mods/ssh.sh -AuthorizedKeysCommandUser nobody -AuthorizedPrincipalsCommand /opt/sbbs/mods/ssh.sh -AuthorizedPrincipalsCommandUser nobody #AuthorizedKeysCommand none #AuthorizedKeysCommandUser nobody @@ -130,4 +126,4 @@ AcceptEnv LANG LC_* # PermitTTY no # ForceCommand cvs server #DisableForwarding yes -PermitOpen 127.0.0.1:513 +PermitOpen haproxy_tcp:513