When I started linux, I heard creating seperate user accounts for specific uses only is a good step to security in linux. I haven’t tried it but after seeing concerns regarding some game launchers snooping around the os, I am trying to see how hard will it be to not let them. I only know the basics of user creation through GUI.

I wont be running games by the way, but I want to have this knowledge of user accounts in linux as a linux security enthusiast. I just want to create a user account where only apps or packages will run with no root access or access to outside its home folder. Even installing apps or packages should not require root to install and must be installed in that home folder and not /usr/bin or /lib. Should be like sandbox environment. I have complete control of permisions and processes of the app. Dont say about flatpak or virtual machines, not talking about that here, just plain old linux.

Note that I am not doing this out of paronoia but as a security enthusiast. I have heard about firejail, SE linux, and WhonixOS but just scratched the surface of it.

How should I do this? I need some sources to read all about linux user accounts.

  • Joe
    link
    fedilink
    arrow-up
    8
    ·
    edit-2
    5 hours ago

    I have two apparmor profiles targeting shell scripts, which can run other programs. One is “audit” (permissive with logging) and the other is “safe” (enforcing).

    The safe profile still has a lot of read access, but not to any directories or files with secrets or private data. Write access is only to the paths and files it needs, and I regularly extend it.

    For a specific program that should have very restricted network access, I have some iptables (& ip6tables) rules that only apply to a particular gid, and I have a setgid wrapper script.

    Note: This is all better than nothing, but proper segregation would be better. Running things on separate PCs, VMs or even unpriviliged containers.

    • LifeLemons@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      55 minutes ago

      I have heard a lot of this apparmor but don’t know anything about it. I know the name explains it, but what is it exactly? What does it do?

      Also you say as if creating profiles and users are different? Isn’t creating user accounts same as creating a new profile in linux, or am I confusing with profiles which are in apparmor?

      Would appreciate some articles and tutorials regarding apparmor

      • Joe
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        42 minutes ago

        An apparmor profile is associated with an executable, based on its filesystem path. I think distributions tend to support either SELinux or Apparmor, but some (like Arch) support both.

        Apparmor profiles are easier to reason about than SELinux, I find.