sftp-share/start.sh

13 lines
237 B
Bash
Raw Normal View History

2014-11-16 15:42:55 +00:00
#!/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} -s /bin/false ${USER}
exec /usr/sbin/sshd