diff --git a/scripts/install b/scripts/install index 9343dd5..8a8fc52 100755 --- a/scripts/install +++ b/scripts/install @@ -33,6 +33,9 @@ install_borg_with_pip ynh_script_progression --message="Configuring user and SSH public key for remote connexion..." ynh_system_user_create --username="$ssh_user" --home_dir="/home/$ssh_user" --use_shell --groups ssh.app +mkdir -p "/home/$ssh_user" +chmod 700 "/home/$ssh_user" +chown "$ssh_user" "/home/$ssh_user" # Tweak to prevent the backup of the backup itself touch "/home/$ssh_user/.nobackup" diff --git a/scripts/restore b/scripts/restore index a352d10..c4163b2 100755 --- a/scripts/restore +++ b/scripts/restore @@ -22,6 +22,9 @@ ynh_restore_file --origin_path="$install_dir" ynh_script_progression --message="Restoring the user and SSH configuration..." --weight=1 ynh_system_user_create --username="$ssh_user" --home_dir="/home/$ssh_user" --use_shell --groups ssh.app +mkdir -p "/home/$ssh_user" +chmod 700 "/home/$ssh_user" +chown "$ssh_user" "/home/$ssh_user" ynh_restore_file --origin_path="/home/$ssh_user/.ssh" ynh_restore_file --origin_path="/home/$ssh_user/.nobackup" diff --git a/scripts/upgrade b/scripts/upgrade index caed06b..52b3813 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -61,6 +61,9 @@ install_borg_with_pip ynh_script_progression --message="Making sure SSH user exists with appropriate permissions..." ynh_system_user_create --username="$ssh_user" --home_dir="/home/$ssh_user" --use_shell --groups ssh.app +mkdir -p "/home/$ssh_user" +chmod 700 "/home/$ssh_user" +chown "$ssh_user" "/home/$ssh_user" # Tweak to prevent the backup of the backup itself touch "/home/$ssh_user/.nobackup"