I want to use a Raspberry Pi as kind of a kiosk display.

So far:

  • I have a Raspberry Pi 4 with Raspbian (Buster) installed.
  • I have 3 users (root, pi and "kiosk"). The user "kiosk" is no sudoer (and should never be).
  • auto-login to GUI for user "kiosk" is in effect
  • a webserver is running (Apache2)

I'm trying to get following to work: I want to display a certain web page based on certain conditions, which are determined by the webserver.

For example on event "ev_a", the browser should display site "site_a", while on event "ev_b" the browser should display site "site_b" (where "site_a" and "site_b" are both remote urls, so no control over them).

I assume it would work if I would execute chrome command as the user "kiosk", but I would have to give sudo rights to the web server (www-data), which I think is not a good idea.

So to put my goal in simple words: A different user should open a web page other than the user currently logged in to the GUI.

Is there any other (more elegant) way?

  • You can limit sudo rights to a given command OR you could give the www-data access to the command by putting the object ownership (or group) to www-data. Bit baffled as to the events and what the page does... if you are accessing GPIO / Bluetooth etc then you will have to make www-data member of the relevant groups.
    – user130616
    Mar 25, 2021 at 22:30
  • What permissions does the kiosk user have? Can you login to Desktop as user kiosk?
    – Milliways
    Mar 25, 2021 at 23:48
  • @Andrew So the event is just something that happens and the server handles this event (e.g. server receives an email, then some remote page should be displayed and after some time another page). Sudo rights for given command seems to be the easiest right now.
    – Andreas
    Mar 26, 2021 at 12:29
  • @Milliways The kiosk user is set up to auto login to Desktop. So when rpi boots, user kiosk gets logged in. The user itself has no special rights. Direct access to web server files is not permitted.
    – Andreas
    Mar 26, 2021 at 12:32


Your Answer

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

Browse other questions tagged or ask your own question.