From 91ff2ae5cf53eb31e5b9c32202997d9e9f27fb7e Mon Sep 17 00:00:00 2001 From: ljf Date: Tue, 13 Jul 2021 13:44:06 +0200 Subject: [PATCH] [fix] Unable to connect with ssh --- scripts/install | 1 + scripts/restore | 2 ++ scripts/upgrade | 9 +++++++++ 3 files changed, 12 insertions(+) diff --git a/scripts/install b/scripts/install index 19f41c5..a7c29c3 100755 --- a/scripts/install +++ b/scripts/install @@ -64,6 +64,7 @@ ynh_script_progression --message="Configuring SSH public key for remote connexio home=/home/$ssh_user mkdir -p /home/$ssh_user/.ssh chmod o=--- /home/$ssh_user +chown -R $ssh_user:$ssh_user /home/$ssh_user touch /home/$ssh_user/.ssh/authorized_keys extra="--storage-quota $quota" if [ "$quota" = "" ]; then diff --git a/scripts/restore b/scripts/restore index 50fd626..410547b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -47,6 +47,8 @@ ynh_system_user_create --username=$ssh_user --home_dir=/home/$ssh_user --use_she home=/home/$ssh_user mkdir -p /home/$ssh_user/.ssh +chmod o=--- /home/$ssh_user +chown -R $ssh_user:$ssh_user /home/$ssh_user touch /home/$ssh_user/.ssh/authorized_keys extra="--storage-quota $quota" if [ "$quota" = "" ]; then diff --git a/scripts/upgrade b/scripts/upgrade index 009582a..9454993 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -100,6 +100,15 @@ ynh_script_progression --message="Upgrading borgbackup..." --weight=1 install_borg_with_pip +#================================================= +# AUTORIZE SSH FOR THIS USER +#================================================= +ynh_script_progression --message="Seting good permissions..." + +mkdir -p /home/$ssh_user/.ssh +chmod o=--- /home/$ssh_user +chown -R $ssh_user:$ssh_user /home/$ssh_user + #================================================= # AVOID BACKUP OF BACKUP #=================================================