mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #5803] ssh: Couldn't open /dev/null: Permission denied #3096
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#3096
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 @fgpietersz on GitHub (Apr 25, 2023).
Original GitHub issue: https://github.com/netblue30/firejail/issues/5803
I had the same problem as with issue #1725 but with version 0.9.72
I tried what one of the users confirming it there tried, deleting ~/.adobe and ~/.macromedia and it fixed it. Looking at backup it looks to me that the cause was that these files were symlinks to /dev/null and the issue can be reproduced by recreating those links.
IIRC this used to be a way of preventing flash cookies. These are old files hanging around in privacy freaks (e.g. me!) home directories.
The relevant lines from running with firejail --debug seem to be:
and
I do not think .ssh needs to open these files (unless I try to sftp them or something) so I am not clear why there is an attempt to open them. Is there a way to ignore such things rather than stop the command running? They are blacklisted in disable-common.inc
@rusty-snake commented on GitHub (Apr 25, 2023):
IDK if you understood it correct, so the summary:
~/.adobe.~/.adobeis a symlink to /dev/null so firejail follows it and blacklists /dev/null@rusty-snake commented on GitHub (Apr 25, 2023):
Technically it works as intended because it does what you asked for. Nevermind following a symlink to
/dev/nulland blacklisting it is almost never wanted by the user so there could be an exception.@fgpietersz commented on GitHub (Apr 25, 2023):
No, I did not properly understand what was happening. I am new to firejail ( I started using it yesterday) nor am I familiar with namespaces etc.. Thanks for the explanation.
If I understand you correctly because ~/.adobe is blacklisted, when firejail sees the symlink it blacklists /dev/null ?
It is confusing and not what I expected, but I see bugs relating to both the behaviour and the debug messages have been closed as notabug so I suppose this is too?
@rusty-snake commented on GitHub (Apr 25, 2023):
Correct.
In general following the symlink is more what users expect. Say you have
~/.gnupgsymlinked to~/gnupgbecause you do not want to work with a hidden folder, then following this symlink causes the blacklist still to work with your new path.Because
mount(2)defaults to following symlinks it's tricky (to impossible?) to blacklist a symlink. Since Linux 5.10 there is aMS_NOSYMFOLLOWflag, however it disables all symlinks as I understand.move_mount(2)(Linux 4.18) can do it if I'm correct.@CRAG666 commented on GitHub (May 1, 2023):
Same problem when trying to use git with ssh
@fgpietersz commented on GitHub (May 1, 2023):
Do you get the error message about /dev/null ? If so are there symlinks to it that are blocklisted? It will show in the output of firejail --debug git push (or pull or clone or whatever).
@Changaco commented on GitHub (Apr 7, 2026):
I have a similar problem arising from the
blacklist-nolog ${HOME}/.*_historyline indisable-common.inc. It affects two different Python programs (github-backupandtox) that both attempt to open/dev/nullin write mode.Symlinks to
/dev/nullshould probably be treated as a special case by firejail since they're a recurrent source of errors. It's never dangerous to allow full access to/dev/null, so firejail should only limit that access if explicitly and directly requested.Python tracebacks
@kmk3 commented on GitHub (Apr 10, 2026):
Here's an attempt to fix it:
@fgpietersz
@CRAG666
@Changaco
Does it fix the errors?
@kmk3 commented on GitHub (Apr 10, 2026):
@rusty-snake
I had the same concern with
mount(2)+MS_NOSYMFOLLOW, but I managed tomake it work here with just
open(2)+O_PATH|O_NOFOLLOWand passing the fdto
mount(2).Not sure if it works on Linux <5.10.
@Changaco commented on GitHub (Apr 11, 2026):
Yes.
Before the patch:
After building and installing the patched firejail:
@kmk3 commented on GitHub (Apr 13, 2026):
@Changaco
Nice, thanks for testing.
@kmk3 commented on GitHub (Apr 13, 2026):
@Zopolis4
If you still use Linux 3.x (such as in #7108), can you test if the PR works?