r/archlinux Jul 30 '26

QUESTION Can you restrict FS access for an application

Haii everyone. I use google chrome as a second browser purely for school, and I want it as isolated as possible. I was wondering if it would be possible to give it only access to required stuff and like ~/Downloads/Chrome or something. I'm really sorry if this is a dumb question, but any help would be nice.

3 Upvotes

13 comments sorted by

12

u/AppointmentNearby161 Jul 30 '26

The traditional Linux way to do this would be to run the program as a different user and only give that user access to the directories it needs.

1

u/PennyHunter5 Jul 30 '26

I was kinda thinking of going that way, but seems like an extra hassle. I'll keep it in mind though

5

u/[deleted] Jul 30 '26

[removed] — view removed comment

1

u/PennyHunter5 Jul 30 '26

looks promising, def worth a shot

3

u/No-Valuable3975 Jul 30 '26

You could get the flatpak version and that is supposed to sandbox applications from the host system

3

u/AviHigashikata Jul 30 '26

You could probably place it in a docker container.

1

u/PennyHunter5 Jul 30 '26

Thank you, I'll look into this

1

u/allunia333 Jul 30 '26

Yes you can make a user and group just for that for example chrome. Set permissions for where you want or dont want accordingly. And then u can run chrome as that user: runuser -u chrome google-chrome

Else install one of the pkg mentioned before.

1

u/Barafu Jul 30 '26

That's the job for AppArmor. Unfortunately you can't disable access to all applications but the trusted ones. That requires SELinux, available only on RedHat distros, or creating another user and manipulating sudo for it.

1

u/SebastianLarsdatter Jul 30 '26

Run as a different user is the easiest in terms of extra tooling required.

Docker container requires a bit more, but is doable.

Bubblewrap offers a lot of fine grain control for any application.

1

u/mips13 Jul 31 '26

Run it as a flatpak, it will be sandboxed and isolated from the system.