From 677a9cca66a5e768a11d6c28698c3e1c5889c28d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 12 Aug 2024 13:35:02 +0200 Subject: [PATCH] Fix: mkdir home --- scripts/install | 3 +++ scripts/restore | 3 +++ scripts/upgrade | 3 +++ 3 files changed, 9 insertions(+) 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"