[GH-ISSUE #1339] Stopping alias #921

Closed
opened 2026-05-05 07:08:59 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @sknepal on GitHub (Jun 16, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1339

Hi,

I ran into an issue. I am using firejail to run restricted bash (rbash) for online repl. One of the ways a user can cause problem to others is by setting alias on .bashrc file. For example: alias python="echo bla". Whenever other users would try to run python now, everyone would see "bla" printed on their screen instead.

When I use --private-home=/home/user/somedir option, this does not take place. The changes to bashrc does not carry over to other user's repl. But when I use --private=/home/user/somedir, this takes place everywhere. Maybe because the modifications are not discarded ?

Now the issue is, --private-home option does not start the bash in the home directory. It starts in a directory above it unlike --private option which starts in the home directory that was given as input. As I am on a restricted bash, I cannot switch to somedir with cd -- its not allowed. I need to switch to the home directory (i.e. somedir) in order to be able to run programs stored there.

Any idea how I could achieve it? Are private-home and private options meant to be working differently in the sense where they start (inside the home dir or outside)?

Thank you!

Originally created by @sknepal on GitHub (Jun 16, 2017). Original GitHub issue: https://github.com/netblue30/firejail/issues/1339 Hi, I ran into an issue. I am using firejail to run restricted bash (rbash) for online repl. One of the ways a user can cause problem to others is by setting alias on .bashrc file. For example: `alias python="echo bla"`. Whenever other users would try to run python now, everyone would see "bla" printed on their screen instead. When I use `--private-home=/home/user/somedir` option, this does not take place. The changes to bashrc does not carry over to other user's repl. But when I use `--private=/home/user/somedir`, this takes place everywhere. Maybe because the modifications are not discarded ? Now the issue is, `--private-home` option does not start the bash in the home directory. It starts in a directory above it unlike `--private` option which starts in the home directory that was given as input. As I am on a restricted bash, I cannot switch to `somedir` with `cd` -- its not allowed. I need to switch to the home directory (i.e. somedir) in order to be able to run programs stored there. Any idea how I could achieve it? Are private-home and private options meant to be working differently in the sense where they start (inside the home dir or outside)? Thank you!
gitea-mirror 2026-05-05 07:08:59 -06:00
Author
Owner

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

--private-home=/home/user/somedir will mount /home/user/somedir on top of /home/user. You cannot cd to somedir, because you are already there, although you appear to be in /home/user. Your bash session will end up using /home/user/somedir/.bashrc.

<!-- gh-comment-id:309277639 --> @netblue30 commented on GitHub (Jun 18, 2017): --private-home=/home/user/somedir will mount /home/user/somedir on top of /home/user. You cannot cd to somedir, because you are already there, although you appear to be in /home/user. Your bash session will end up using /home/user/somedir/.bashrc.
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#921
No description provided.