diff --git a/sftp/hooks/init b/sftp/hooks/init index 8a318427..db74b9a5 100755 --- a/sftp/hooks/init +++ b/sftp/hooks/init @@ -20,9 +20,12 @@ users_def=$(echo "$service_def" | shyaml get-value options.users 2>/dev/null) || users_file="$SERVICE_CONFIGSTORE/etc/sftp-users.conf" echo | file_put "$users_file" +rm -f "$SERVICE_DATASTORE/home/"*"/.ssh/authorized_keys" + [ "$users_def" ] || exit 0 rm -f "$users_file" + volume_keys=() while read-0 login user_def; do key_nb=0 @@ -57,3 +60,4 @@ $(for volume in "${volume_keys[@]}"; do echo " - $volume" done) " +