8
1mon
3

Do you know any software available on GNU+Linux that locks your computer/laptop unto a few websites of your choice for a certain amount of time, and doesn't let you open/close any tabs/apps?

preferably foss and self hosted

DigitalDilemma - 1mon

I think what you're looking for is known as kiosk software. Basically a locked down browser that has limited or zero user interaction possible.

Or by deliberately breaking DNS on that host. Add the entries you want to allow to /etc/hosts and not supply any upstream DNS servers. (Change of needing maintenance if those sites change IP)

10
Otherbarry - 1mon

Most/all the main web browsers in use support kiosk mode, you'll just need to search around for how to do it. This should get you going for Firefox

https://support.mozilla.org/en-US/kb/firefox-enterprise-kiosk-mode

Am not too sure how to get out of kiosk mode afterwards, maybe test it when you don't have anything else running just in case.

EDIT: If you need to run kiosk mode for a specific amount of time as you say, you'll probably need to also run a scheduled cronjob or similar to maybe kill the web browser at a specific time. I've seen kiosk mode for a few web browsers but they don't usually have an option to set them for a specific amount of time.

3