[RPi] Cleaning up permission issues

Posted by Matthias 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
[RPi] Cleaning up permission issues
December 26, 2017 07:17AM
TerrorByte mentioned an issue regardings the permissions, which has a frequent negative effect on the user experience: Permission issues between login user alarm , PirateBox user nobody and root user.
So you currently can not use SCP to transfer files or do modifications. You always need to switch between root and not root using sudo or su.

So, my first shot to solve this issue is the following approach:

- Make the alarm user like a second user for other applications
- Create a new user "piratebox" (or similar) (short puser) including a fixed UID, GID
- Adjust the LIGHTTPD User and Group to that user
- Add a manual step to add a password for puser , that it is usable beside alarm
- Change ownership of opt/piratebox to puser entirely
- Change SDCard and USB Mount scripts to add UID and GID for the new user as a mount option

I am bivalent about the sudo rights. It would be helpful to give users sudo rights, to do needed restart steps from the puser. But on the other side, you can enable root access as well then... it would be the same.
Mh.

What do you think? Opinions?

best regards Matthias
Re: [RPi] Cleaning up permission issues
February 22, 2018 09:45PM
Ok, bigger update on this:

I changed the image creation for RPi, that a separate user&group "pbxuser" is created. The user has sudo permissions. The default alarm user is disabled, but can be activated later (using passwd). The root user is still active.
During login, the user has to set a new login password for pbxuser. After that, everything is a piece of cake ;-)

Droopy & Lighttpd is running as pbxuser and at the same time, the file permissions are read-writable for that new user. The same is true for the configuration files in /opt/piratebox/conf ..
That all should help alot.

In addition, I added /opt/piratebox/bin and /opt/piratebox/rpi/bin to the PATH variable, so it is just entering "board_autoconfig.sh" to setup the imageboard.

I also removed some manual steps, we can easily do upfront.

best regards Matthias