This repository was archived by the owner on Sep 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
This repository was archived by the owner on Sep 27, 2020. It is now read-only.
secure recalbox-manager #63
Copy link
Copy link
Open
Labels
Description
Starting with recalbox 4.1, recalbox.conf has a variable : system.security.enabled
if this is one, the recalbox manager (among others) must not be open.
It must be secured.
- at minimum by a basic http password
- if possible, via ssl while the aim is to secure from network attacks
the login is what you want, but the password to use is the one provided by /etc/init.d/S35rootpasswd
it's in this starting script that you must generate a password file in the temporary location.
I don't manage to do it by myself.
I don't known django and i don't see in recalbox the same configuration files that i found in django documentation (like httpd.conf for example).
The current script content is :
# /etc/shadow is dynamically generated from the password found in /boot/recalbox-boot.conf
# the password is visible only in the es interface
# or to people having already a ssh password via the command : /recalbox/scripts/recalbox-config.sh setRootPassword xyz
MASTERPASSWD=$(/recalbox/scripts/recalbox-config.sh getRootPassword)
if test -z "${MASTERPASSWD}"
then
# generate a new one
# hum, in case of error, what to do ? nothing.
/recalbox/scripts/recalbox-config.sh setRootPassword
MASTERPASSWD=$(/recalbox/scripts/recalbox-config.sh getRootPassword)
fi
# secure ssh
# write the /etc/shadow file
SHADOWPASSWD=$(openssl passwd -1 "${MASTERPASSWD}")
echo "root:${SHADOWPASSWD}:::::::" > /run/recalbox.shadow
# secure samba
mkdir -p "/var/lib/samba/private"
(echo "${MASTERPASSWD}"; echo "${MASTERPASSWD}") | smbpasswd -a root
#