[GH-ISSUE #1332] private-etc with custom files #912

Closed
opened 2026-05-05 07:08:02 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @allo- on GitHub (Jun 11, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1332

Would it be possible to create a private-etc with custom files?
This means not copying /etc/passwd to the jail, but copying ~/firejail/etc/passwd to /etc/passwd in the jail, so you can i.e. hide which users exist outside of the jail and still have a working passwd file with users like root and the user running firejail (even with changed name, i guess only the uid needs to match inside the jail).
There is --bind, but it works only for root. And I do not need to bind the file, copying it is sufficient (and sometimes even preferable).

Originally created by @allo- on GitHub (Jun 11, 2017). Original GitHub issue: https://github.com/netblue30/firejail/issues/1332 Would it be possible to create a private-etc with custom files? This means not copying ``/etc/passwd`` to the jail, but copying ``~/firejail/etc/passwd`` to ``/etc/passwd`` in the jail, so you can i.e. hide which users exist outside of the jail and still have a working passwd file with users like root and the user running firejail (even with changed name, i guess only the uid needs to match inside the jail). There is ``--bind``, but it works only for root. And I do not need to bind the file, copying it is sufficient (and sometimes even preferable).
gitea-mirror 2026-05-05 07:08:02 -06:00
Author
Owner

@netblue30 commented on GitHub (Jun 14, 2017):

This will bring in a lot of security problems.

<!-- gh-comment-id:308393867 --> @netblue30 commented on GitHub (Jun 14, 2017): This will bring in a lot of security problems.
Author
Owner

@allo- commented on GitHub (Jun 14, 2017):

I want to copy a file owned by a non-root user into a jail started by a non-root user.
I do not see the security issues, can you give an rough example why this could be a problem?

<!-- gh-comment-id:308477188 --> @allo- commented on GitHub (Jun 14, 2017): I want to copy a file owned by a non-root user into a jail started by a non-root user. I do not see the security issues, can you give an rough example why this could be a problem?
Author
Owner

@netblue30 commented on GitHub (Jun 16, 2017):

All you have to do is to bring in a different /etc/shadow file and su to root after the sandbox started.

<!-- gh-comment-id:308900514 --> @netblue30 commented on GitHub (Jun 16, 2017): All you have to do is to bring in a different /etc/shadow file and su to root after the sandbox started.
Author
Owner

@allo- commented on GitHub (Jun 16, 2017):

OK. I need to look more into the infrastructure. Though it uses user mode jails when not run as root.

<!-- gh-comment-id:308951592 --> @allo- commented on GitHub (Jun 16, 2017): OK. I need to look more into the infrastructure. Though it uses user mode jails when not run as root.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#912
No description provided.