1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/borgserver_ynh.git synced 2024-09-03 20:36:20 +02:00

Fix .ssh directory rights

This commit is contained in:
Simon Vernhes 2024-07-09 18:12:43 +02:00 committed by GitHub
parent 4c8c3cabad
commit c9086362e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,13 +37,15 @@ ynh_system_user_create --username=$ssh_user --home_dir=/home/$ssh_user --use_she
home=/home/$ssh_user
mkdir -p $home/.ssh
chmod o=--- $home
chown -R $ssh_user:$ssh_user $home
chmod 700 $home/.ssh
touch $home/.ssh/authorized_keys
extra="--storage-quota $quota"
if [ "$quota" = "" ]; then
extra=""
fi
echo "command=\"borg serve $extra --restrict-to-repository $home/backup\",no-pty,no-agent-forwarding,no-port-forwarding,no-X11-forwarding,no-user-rc $public_key" >> $home/.ssh/authorized_keys
chmod 600 $home/.ssh/authorized_keys
chown -R $ssh_user:$ssh_user $home
# Tweak to prevent the backup of the backup itself
touch $home/.nobackup