sftp-share/start.sh
2014-11-16 16:48:50 +01:00

12 lines
245 B
Bash

#!/bin/bash
ENC_PASS=$(perl -e 'print crypt($ARGV[0], "password")' ${PASS})
if ( id ${USER} ); then
echo "FATAL: User ${USER} already exists"
exit 1
fi
useradd -d /data -m -p ${ENC_PASS} -u 1000 -s /bin/false ${USER}
exec /usr/sbin/sshd