mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3892] Option to launch firejailed program as a different user #2444
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#2444
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @scruloose on GitHub (Jan 13, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3892
I would like to revive the request in issue #208 for the ability to run programs inside Firejail as an entirely different local *NIX user.
Similar to the OP of that issue, what I have in mind is something like this:
an extensive porn stashits own persistent.firefoxtree for persistent browser settings, the whole meal deal;sudo firejail --runas=<seconduser> <program-to-run>, I could launch Firefox or SMplayer or whatever, in a Firejail sandbox, using Xpra or Xephyr or whatever, as the secondary user, using that user's own home dir, its own ~/.config tree, its own file-access permissions, its own everything, but export the window back to my existing desktop.This would allow mixing and matching the strengths of sandboxing with the strengths of *NIX account separation (second user can have a different umask, its own system-enforced disk quota, its own group memberships, etc), while keeping the convenience of a single desktop environment.
Oddly, the thread for issue #208 seems to indicate that this ability was actually added in early 2016… but by a year and a half later it had been "removed a long time ago".
I don't know what prompted the removal of this feature shortly after implementing it, but if it was removed due to factors that are reasonably easy to resolve (or no longer relevant 5 years later), this is something that I for one would find really handy to have.
@ghost commented on GitHub (Jan 14, 2021):
Wouldn't this be simply
sudo -u <seconduser> firejail <program-to-run>?@akhouderchah commented on GitHub (Mar 19, 2021):
IIUC, that's assuming seconduser has permission to execute firejail. Given the nature of SUID binaries in the context of privilege escalation, they are high-value targets, and so ideally seconduser wouldn't be able to use firejail. Under the assumption that all processes running as seconduser are sandboxed and have no access to firejail, I'm not sure how much benefit a --user flag would be outside of configuration errors, but retaining that additional layer of security doesn't seem so outlandish for a project specifically designed around security and whose users likely have a {,un}healthy amount of paranoia.
FWIW, it seems like the option was removed specifically under the assumption that a --user flag has no benefit over
sudo -u:ab36d4527f@rusty-snake commented on GitHub (Apr 6, 2021):
Do we want this or should we close?
@kmk3 commented on GitHub (Apr 7, 2021):
@Khouderchah-Alex commented 19 days ago:
Personally, I have also wondered about this exact same problem.
To me, from a high-level perspective, this:
seems more secure than this:
@rusty-snake commented yesterday:
I have no idea about the costs of implementing this, so I'll just leave my "+1
nice to have" here.
@kmk3 commented on GitHub (Apr 7, 2021):
By the way, I see that there is a "wontfix" label, but it is currently only
used for #107 and #1743, and I suspect that there is more of such issues:
If this is resolved as a "wontfix", please consider using that label to make it
obvious at a glance why the issue was closed.
@diyism commented on GitHub (Oct 22, 2022):
I'm trying to use firejail in a seperated user:
How to fix the "Error: cannot write to /proc/328747/gid_map: Invalid argument" ?
@rusty-snake commented on GitHub (Oct 22, 2022):
@diyism this is a complete other issue/question. Pleas open a new issue/discussion for it.