0

I am new to this so hopefully, I am not breaking any rules and get the help I need. So, with my question, I made a guest user for siblings and other people, and I want to change permissions so they don't goof around and mess up my Raspberry Pi. So for starters, I have already removed sudo commands from Guest. How do I change permissions for Guest so they do not...

  • Prevent from installing different software
  • No access reading/writing to other directories except in the home/guest folder
  • Prevent from changing important settings for the Raspberry Pi Configuration (Screen resolution, drivers, wifi credentials, etc)
  • Etc.

Your help is highly appreciated. :)

1
  • 2
    This is a general Linux question. If you want help you need to explain more about what you did e.g. " I have already removed sudo commands from Guest" - newly created users would't have sudo.
    – Milliways
    Commented Feb 21, 2020 at 0:13

1 Answer 1

1

Debian/Raspbian is made out of the box to prevent normal user to do serious things. This can only be done with root rights that you get with the command sudo. But you can only execute sudo if the user is member of the group sudo. User pi is member of the group sudo of course but not a normal user you have just created with e.g. sudo adduser guest. As user pi you can check the groups of user guest with:

rpi ~$ groups guest
guest : guest

As you see by default user guest is only member of its own group guest but not a member of group sudo in contrast to user pi:

rpi ~$ groups pi
pi : pi adm dialout cdrom sudo audio video plugdev games users input netdev spi i2c gpio

He can do many things.

So don't worry about your guests. They can do things only in their home directory but cannot install software system wide, only in their home directory and they cannot modify system settings.

By default on Debian/Raspbian everybody can read the home directory of the other accounts. You can try to prevent this by removing the read and list permission (r-x) for others from the home directory, for example on pi:

rpi ~$ ls -ld /home/pi
drwxr-xr-x 4 pi pi 4096 Feb 21 19:28 /home/pi

rpi ~$ chmod o-rx /home/pi

rpi ~$ ls -ld /home/pi
drwxr-x--- 4 pi pi 4096 Feb 21 19:28 /home/pi
       ^ ^ read and list permissions for others removed

I don't know if this has other side effects, maybe execution of scripts in that home directory. Try it. If you want to manage more detailed user rights you have to look at the Unix rights management. There are many tutorials on the web. I cannot give another one here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.