mirror of
https://github.com/luzifer-docker/sftp-share.git
synced 2024-12-20 22:11:16 +00:00
Custom UID and made container restartable
This commit is contained in:
parent
5767071943
commit
fd81a785db
2 changed files with 6 additions and 6 deletions
|
@ -3,6 +3,7 @@ MAINTAINER Knut Ahlers <knut@ahlers.me>
|
|||
|
||||
ENV USER share
|
||||
ENV PASS changeme
|
||||
ENV USER_UID 1000
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y openssh-server mcrypt && \
|
||||
|
|
11
start.sh
11
start.sh
|
@ -1,12 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
ENC_PASS=$(perl -e 'print crypt($ARGV[0], "password")' ${PASS})
|
||||
|
||||
if ( id ${USER} ); then
|
||||
echo "FATAL: User ${USER} already exists"
|
||||
exit 1
|
||||
echo "INFO: User ${USER} already exists"
|
||||
else
|
||||
echo "INFO: User ${USER} does not exists, we create it"
|
||||
ENC_PASS=$(perl -e 'print crypt($ARGV[0], "password")' ${PASS})
|
||||
useradd -d /data -m -p ${ENC_PASS} -u ${USER_UID} -s /bin/sh ${USER}
|
||||
fi
|
||||
|
||||
useradd -d /data -m -p ${ENC_PASS} -u 1000 -s /bin/sh ${USER}
|
||||
|
||||
exec /usr/sbin/sshd -D
|
||||
|
|
Loading…
Reference in a new issue