0
0
Fork 0
mirror of https://github.com/atmoz/sftp.git synced 2024-12-08 13:05:39 -05:00

Merge branch 'master' into alpine

This commit is contained in:
Adrian Dvergsdal 2016-09-28 10:53:21 +02:00
commit 88abc3749f
3 changed files with 14 additions and 12 deletions

View file

@ -61,13 +61,12 @@ function createUser() {
chown root:root /home/$user
chmod 755 /home/$user
if [ -z "$pass" ]; then
pass="$(tr -dc A-Za-z0-9 </dev/urandom | head -c256)"
chpasswdOptions=""
if [ -n "$pass" ]; then
echo "$user:$pass" | chpasswd $chpasswdOptions
else
usermod -p "*" $user # disabled password
fi
echo "$user:$pass" | chpasswd $chpasswdOptions
# Add SSH keys to authorized_keys with valid permissions
if [ -d /home/$user/.ssh/keys ]; then
cat /home/$user/.ssh/keys/* >> /home/$user/.ssh/authorized_keys

View file

@ -1 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDHDDQw9a9miGWDEXLG9mMR7OuV3ufmkgm5htntuZnxRw1sUfySmgeaY5ZDvHw5uEMulxYS/yJ+hLxFgsj3tUwIlwRz9yRyrzZm+gBE4Xhsb+NhdaMQdFnMSn3cUw8UHO8FmRd4FLiSx32x+pF83JnNR67+3fzSg2wKmvz5OdoQSELn4TpRuOt4fQI+22QPRpGOuzN6vWGQazY/LzRVlKeJ1kasVE1p/GKCNwtE2nhkk3B4VzuZy4sh8Fqklcgka6PZcDGu3zqkFCgRJ9oRODSbcNaXhnXDrBlnbpaciJU4d2JdyPdTS11nAKLE+KEfnJhjLLp8TXWQzD2xB2HH7gEd atmoz@arch-book
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDHDDQw9a9miGWDEXLG9mMR7OuV3ufmkgm5htntuZnxRw1sUfySmgeaY5ZDvHw5uEMulxYS/yJ+hLxFgsj3tUwIlwRz9yRyrzZm+gBE4Xhsb+NhdaMQdFnMSn3cUw8UHO8FmRd4FLiSx32x+pF83JnNR67+3fzSg2wKmvz5OdoQSELn4TpRuOt4fQI+22QPRpGOuzN6vWGQazY/LzRVlKeJ1kasVE1p/GKCNwtE2nhkk3B4VzuZy4sh8Fqklcgka6PZcDGu3zqkFCgRJ9oRODSbcNaXhnXDrBlnbpaciJU4d2JdyPdTS11nAKLE+KEfnJhjLLp8TXWQzD2xB2HH7gEd test

View file

@ -19,15 +19,19 @@ else
redirect="/dev/stdout"
fi
buildOptions="--tag $sftpImageName"
##############################################################################
function beforeTest() {
if [ "$build" == "build" ]; then
docker build --pull=true --tag "$sftpImageName" "$buildDir"
if [ $? -gt 0 ]; then
echo "Build failed"
exit 1
fi
buildOptions="$buildOptions --no-cache --pull=true"
fi
docker build $buildOptions "$buildDir"
if [ $? -gt 0 ]; then
echo "Build failed"
exit 1
fi
# Private key can not be read by others
@ -81,7 +85,6 @@ function runSftpCommands() {
-b - $user@$ip \
> "$redirect" 2>&1
sleep 1 # wait for command to finish
}
##############################################################################