mirror of
https://github.com/YunoHost-Apps/restic_ynh.git
synced 2024-09-03 20:16:22 +02:00
improve right management
This commit is contained in:
parent
06a1842642
commit
cd3a2fff2e
2 changed files with 4 additions and 0 deletions
|
@ -55,6 +55,7 @@ cat > /tmp/${app}_sudoer << EOSUDOER
|
|||
${app} ALL = (root) NOPASSWD: /usr/bin/yunohost*, /bin/journalctl*, /usr/bin/find /etc/yunohost/apps -name backup, ${final_path}/check_method_${app}
|
||||
EOSUDOER
|
||||
visudo -cf /tmp/${app}_sudoer && mv /tmp/${app}_sudoer /etc/sudoers.d/${app}
|
||||
chmod 644 /etc/sudoers.d/${app}
|
||||
|
||||
#=================================================
|
||||
# ACTIVATE BACKUP METHODS
|
||||
|
@ -156,6 +157,7 @@ Host ${server}
|
|||
UserKnownHostsFile /dev/null
|
||||
# end $app ssh config
|
||||
EOCONF
|
||||
chmod 700 ${ssh_dir}/config
|
||||
|
||||
#=================================================
|
||||
# Display key
|
||||
|
|
|
@ -76,6 +76,7 @@ cat > /tmp/${app}_sudoer << EOSUDOER
|
|||
${app} ALL = (root) NOPASSWD: /usr/bin/yunohost*, /bin/journalctl*, /usr/bin/find /etc/yunohost/apps -name backup, ${final_path}/check_method_${app}
|
||||
EOSUDOER
|
||||
visudo -cf /tmp/${app}_sudoer && mv /tmp/${app}_sudoer /etc/sudoers.d/${app}
|
||||
chmod 644 /etc/sudoers.d/${app}
|
||||
ynh_script_progression --message="Move ssh keys from root to ${app} user's home"
|
||||
ynh_script_progression --message="Generate ssh config"
|
||||
set +o errexit
|
||||
|
@ -98,6 +99,7 @@ if [ "$missing_conf" -eq "1" ];then
|
|||
UserKnownHostsFile /dev/null
|
||||
# end $app ssh config
|
||||
EOCONF
|
||||
chmod 700 ${ssh_dir}/config
|
||||
fi
|
||||
chown -R ${app}: /home/${app}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue