1FIREJAIL(1)                    firejail man page                   FIREJAIL(1)
2
3
4

NAME

6       Firejail - Linux namespaces sandbox program
7

SYNOPSIS

9       Start a sandbox:
10
11              firejail [OPTIONS] [program and arguments]
12
13       Start an AppImage program:
14
15              firejail [OPTIONS] --appimage [appimage-file and arguments]
16
17       File transfer from an existing sandbox
18
19              firejail {--ls | --get | --put | --cat} dir_or_filename
20
21       Network traffic shaping for an existing sandbox:
22
23              firejail --bandwidth={name|pid} bandwidth-command
24
25       Monitoring:
26
27              firejail {--list | --netstats | --top | --tree}
28
29       Miscellaneous:
30
31              firejail  {-? | --debug-caps | --debug-errnos | --debug-syscalls
32              | --debug-syscalls32 | --debug-protocols | --help | --version}
33

DESCRIPTION

35       Firejail is a SUID sandbox program that reduces the  risk  of  security
36       breaches  by  restricting the running environment of untrusted applica‐
37       tions using Linux namespaces, seccomp-bpf and Linux  capabilities.   It
38       allows a process and all its descendants to have their own private view
39       of the globally shared kernel resources, such  as  the  network  stack,
40       process table, mount table.  Firejail can work in a SELinux or AppArmor
41       environment, and it is integrated with Linux Control Groups.
42
43       Written in C with virtually no dependencies, the software runs  on  any
44       Linux  computer with a 3.x kernel version or newer.  It can sandbox any
45       type of processes: servers, graphical applications, and even user login
46       sessions.
47
48       Firejail  allows the user to manage application security using security
49       profiles.  Each profile defines a set of permissions for a specific ap‐
50       plication or group of applications. The software includes security pro‐
51       files for a number of more common Linux programs, such as Mozilla Fire‐
52       fox, Chromium, VLC, Transmission etc.
53
54       Alternative  sandbox technologies like snap (https://snapcraft.io/) and
55       flatpak (https://flatpak.org/) are  not  supported.  Snap  and  flatpak
56       packages  have their own native management tools and will not work when
57       sandboxed with Firejail.
58
59

USAGE

61       Without any options, the sandbox consists of a filesystem  build  in  a
62       new  mount  namespace, and new PID and UTS namespaces. IPC, network and
63       user namespaces can be added using the command line  options.  The  de‐
64       fault Firejail filesystem is based on the host filesystem with the main
65       system directories mounted read-only. These directories are /etc, /var,
66       /usr,  /bin,  /sbin,  /lib,  /lib32, /libx32 and /lib64. Only /home and
67       /tmp are writable.
68
69       Upon execution Firejail first looks in ~/.config/firejail/ for  a  pro‐
70       file  and if it doesn't find one, it looks in /etc/firejail/.  For pro‐
71       file   resolution   detail    see    https://github.com/netblue30/fire
72       jail/wiki/Creating-Profiles#locations-and-types.    If  an  appropriate
73       profile is not found, Firejail will use a default profile.  The default
74       profile is quite restrictive. In case the application doesn't work, use
75       --noprofile option to disable it. For more information, please see  SE‐
76       CURITY PROFILES section below.
77
78       If a program argument is not specified, Firejail starts the user's pre‐
79       ferred shell.  Examples:
80
81       $ firejail [OPTIONS]                # starting the program specified in
82       $SHELL, usually /bin/bash
83
84       $ firejail [OPTIONS] firefox        # starting Mozilla Firefox
85
86       # sudo firejail [OPTIONS] /etc/init.d/nginx start
87
88

OPTIONS

90       --     Signal  the  end of options and disables further option process‐
91              ing.
92
93       --allow-debuggers
94              Allow tools such  as  strace  and  gdb  inside  the  sandbox  by
95              whitelisting  system calls ptrace and process_vm_readv. This op‐
96              tion is only available when running  on  Linux  kernels  4.8  or
97              newer  - a kernel bug in ptrace system call allows a full bypass
98              of the seccomp filter.
99
100              Example:
101              $  firejail    --allow-debuggers   --profile=/etc/firejail/fire‐
102              fox.profile strace -f firefox
103
104       --allusers
105              All  directories  under /home are visible inside the sandbox. By
106              default, only current user home directory is visible.
107
108              Example:
109              $ firejail --allusers
110
111       --appimage
112              Sandbox an AppImage (https://appimage.org/) application. If  the
113              sandbox  is  started as a regular user, nonewprivs and a default
114              capabilities filter are enabled.   private-bin  and  private-lib
115              are disabled by default when running appimages.
116
117              Example:
118              $ firejail --appimage krita-3.0-x86_64.appimage
119              $ firejail --appimage --private krita-3.0-x86_64.appimage
120              $ firejail --appimage --net=none --x11 krita-3.0-x86_64.appimage
121
122       --audit
123              Audit the sandbox, see AUDIT section for more details.
124
125       --audit=test-program
126              Audit the sandbox, see AUDIT section for more details.
127
128       --bandwidth=name|pid
129              Set  bandwidth limits for the sandbox identified by name or PID,
130              see TRAFFIC SHAPING section for more details.
131
132       --bind=filename1,filename2
133              Mount-bind filename1 on top of filename2. This  option  is  only
134              available when running as root.
135
136              Example:
137              # firejail --bind=/config/etc/passwd,/etc/passwd
138
139       --blacklist=dirname_or_filename
140              Blacklist  directory  or  file.  File globbing is supported, see
141              FILE GLOBBING section for more details.
142
143              Example:
144              $ firejail --blacklist=/sbin --blacklist=/usr/sbin
145              $ firejail --blacklist=~/.mozilla
146              $ firejail "--blacklist=/home/username/My Virtual Machines"
147              $ firejail --blacklist=/home/username/My\ Virtual\ Machines
148
149       --build
150              The command builds a whitelisted profile. The profile is printed
151              on the screen. If /usr/bin/strace is installed on the system, it
152              also builds a whitelisted seccomp profile. The program is run in
153              a  very  relaxed sandbox, with only --caps.drop=all and --nonew‐
154              privs. Programs that raise user privileges are not supported  in
155              order  to  allow  strace  to  run.  Chromium  and Chromium-based
156              browsers will not work.
157
158              Example:
159              $ firejail --build vlc ~/Videos/test.mp4
160
161       --build=profile-file
162              The command builds a whitelisted profile, and saves it  in  pro‐
163              file-file.  If  /usr/bin/strace  is  installed on the system, it
164              also builds a whitelisted seccomp profile. The program is run in
165              a  very  relaxed sandbox, with only --caps.drop=all and --nonew‐
166              privs. Programs that raise user privileges are not supported  in
167              order  to  allow  strace  to  run.  Chromium  and Chromium-based
168              browsers will not work.
169
170              Example:
171              $ firejail --build=vlc.profile vlc ~/Videos/test.mp4
172
173       -c     Login shell compatibility option. This option is use by some lo‐
174              gin  programs when executing the login shell, such as when fire‐
175              jail is used as a restricted login shell. It currently does  not
176              change the execution of firejail.
177
178       --caps Linux  capabilities is a kernel feature designed to split up the
179              root privilege into a set of distinct privileges.  These  privi‐
180              leges can be enabled or disabled independently, thus restricting
181              what a process running as root can do in the system.
182
183              By default root programs  run  with  all  capabilities  enabled.
184              --caps  option disables the following capabilities: CAP_SYS_MOD‐
185              ULE, CAP_SYS_RAWIO, CAP_SYS_BOOT, CAP_SYS_NICE, CAP_SYS_TTY_CON‐
186              FIG,  CAP_SYSLOG,  CAP_MKNOD,  CAP_SYS_ADMIN.  The filter is ap‐
187              plied to all processes started in the sandbox.
188
189              Example:
190              $ sudo firejail --caps /etc/init.d/nginx start
191
192
193       --caps.drop=all
194              Drop all capabilities for the processes running in the  sandbox.
195              This option is recommended for running GUI programs or any other
196              program that doesn't require root privileges. It is a  must-have
197              option  for sandboxing untrusted programs installed from unoffi‐
198              cial sources - such as games, Java programs, etc.
199
200              Example:
201              $ firejail --caps.drop=all warzone2100
202
203
204       --caps.drop=capability,capability,capability
205              Define a custom blacklist Linux capabilities filter.
206
207              Example:
208              $ firejail --caps.drop=net_broadcast,net_admin,net_raw
209
210
211       --caps.keep=capability,capability,capability
212              Define a custom whitelist Linux capabilities filter.
213
214              Example:
215              $ sudo firejail --caps.keep=chown,net_bind_service,setgid,\  se‐
216              tuid /etc/init.d/nginx start
217
218
219       --caps.print=name|pid
220              Print  the  caps filter for the sandbox identified by name or by
221              PID.
222
223              Example:
224              $ firejail --name=mygame --caps.drop=all warzone2100 &
225              $ firejail --caps.print=mygame
226
227              Example:
228              $ firejail --list
229              3272:netblue::firejail --private firefox
230              $ firejail --caps.print=3272
231
232
233       --cat=name|pid filename
234              Print content of file from sandbox container, see FILE  TRANSFER
235              section for more details.
236
237       --cgroup=tasks-file
238              Place  the sandbox in the specified control group. tasks-file is
239              the full path of cgroup tasks file.
240
241              Example:
242              # firejail --cgroup=/sys/fs/cgroup/g1/tasks
243
244       --chroot=dirname
245              Chroot the sandbox into a root filesystem.  Unlike  the  regular
246              filesystem  container,  the system directories are mounted read-
247              write. If the sandbox is started as a regular  user,  nonewprivs
248              and a default capabilities filter are enabled.
249
250              Example:
251              $ firejail --chroot=/media/ubuntu warzone2100
252
253       --cpu=cpu-number,cpu-number,cpu-number
254              Set CPU affinity.
255
256              Example:
257              $ firejail --cpu=0,1 handbrake
258
259
260       --cpu.print=name|pid
261              Print  the CPU cores in use by the sandbox identified by name or
262              by PID.
263
264              Example:
265              $ firejail --name=mygame --caps.drop=all warzone2100 &
266              $ firejail --cpu.print=mygame
267
268              Example:
269              $ firejail --list
270              3272:netblue::firejail --private firefox
271              $ firejail --cpu.print=3272
272
273       --dbus-log=file
274              Specify the location for the DBus log file.
275
276              The log file contains events for both  the  system  and  session
277              buses  if  both  of the --dbus-sysem.log and --dbus-user.log op‐
278              tions are specified. If no log file  path  is  given,  logs  are
279              written to the standard output instead.
280
281              Example:
282              $ firejail --dbus-system=filter --dbus-system.log \
283              --dbus-log=dbus.txt
284
285
286       --dbus-system=filter|none
287              Set system DBus sandboxing policy.
288
289              The  filter  policy  enables the system DBus filter. This option
290              requires installing the xdg-dbus-proxy utility. Permissions  for
291              well-known  can  be  specified  with  the --dbus-system.talk and
292              --dbus-system.own options.
293
294              The none policy disables access to the system DBus.
295
296              Only the regular system DBus UNIX socket is handled by this  op‐
297              tion. To disable the abstract sockets (and force applications to
298              use the filtered UNIX socket) you would need to  request  a  new
299              network  namespace using --net command. Another option is to re‐
300              move unix from the --protocol set.
301
302              Example:
303              $ firejail --dbus-system=none
304
305
306       --dbus-system.broadcast=name=[member][@path]
307              Allows  the  application  to  receive  broadcast  signals   from
308              theindicated  interface  member at the indicated object path ex‐
309              posed by the indicated bus name on the system  DBus.   The  name
310              may have a .* suffix to match all names underneath it, including
311              itself.  The interface member may have a .* to match all members
312              of  an interface, or be * to match all interfaces.  The path may
313              have a /* suffix to indicate all objects underneath it,  includ‐
314              ing  itself.   Omitting  the interface member or the object path
315              will match all members and object paths, respectively.
316
317              Example:
318              $ firejail --dbus-system=filter --dbus-system.broadcast=\
319              org.freedesktop.Notifications=\
320              org.freedesktop.Notifications.*@/org/freedesktop/Notifications
321
322
323       --dbus-system.call=name=[member][@path]
324              Allows the application to call the indicated interface member at
325              the  indicated  object path exposed by the indicated bus name on
326              the system DBus.  The name may have a .*  suffix  to  match  all
327              names underneath it, including itself.  The interface member may
328              have a .* to match all members of an interface, or be * to match
329              all  interfaces.   The path may have a /* suffix to indicate all
330              objects underneath it, including itself.  Omitting the interface
331              member  or  the  object  path  will match all members and object
332              paths, respectively.
333
334              Example:
335              $ firejail --dbus-system=filter --dbus-system.call=\
336              org.freedesktop.Notifications=\
337              org.freedesktop.Notifications.*@/org/freedesktop/Notifications
338
339
340       --dbus-system.log
341              Turn on DBus logging for the system DBus. This  option  requires
342              --dbus-system=log.
343
344              Example:
345              $ firejail --dbus-system=filter --dbus-system.log
346
347
348       --dbus-system.own=name
349              Allows  the  application to own the specified well-known name on
350              the system DBus.  The name may have a .*  suffix  to  match  all
351              names  underneath it, including itself (e.g. "foo.bar.*" matches
352              "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but  not  "foo‐
353              bar").
354
355              Example:
356              $ firejail --dbus-system=filter --dbus-system.own=\
357              org.gnome.ghex.*
358
359
360       --dbus-system.see=name
361              Allows  the  application  to  see, but not talk to the specified
362              well-known name on the system DBus.  The name may have a .* suf‐
363              fix  to  match  all  names underneath it, including itself (e.g.
364              "foo.bar.*"     matches     "foo.bar",     "foo.bar.baz"     and
365              "foo.bar.baz.quux", but not "foobar").
366
367              Example:
368              $ firejail --dbus-system=filter --dbus-system.see=\
369              org.freedesktop.Notifications
370
371
372       --dbus-system.talk=name
373              Allows  the application to talk to the specified well-known name
374              on the system DBus.  The name may have a .* suffix to match  all
375              names  underneath it, including itself (e.g. "foo.bar.*" matches
376              "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but  not  "foo‐
377              bar").
378
379              Example:
380              $ firejail --dbus-system=filter --dbus-system.talk=\
381              org.freedesktop.Notifications
382
383
384       --dbus-user=filter|none
385              Set session DBus sandboxing policy.
386
387              The  filter  policy enables the session DBus filter. This option
388              requires installing the xdg-dbus-proxy utility. Permissions  for
389              well-known  names  can  be  added  with the --dbus-user.talk and
390              --dbus-user.own options.
391
392              The none policy disables access to the session DBus.
393
394              Only the regular session DBus UNIX socket is handled by this op‐
395              tion. To disable the abstract sockets (and force applications to
396              use the filtered UNIX socket) you would need to  request  a  new
397              network  namespace using --net command. Another option is to re‐
398              move unix from the --protocol set.
399
400              Example:
401              $ firejail --dbus-user=none
402
403
404       --dbus-user.broadcast=name=[member][@path]
405              Allows  the  application  to  receive  broadcast  signals   from
406              theindicated  interface  member at the indicated object path ex‐
407              posed by the indicated bus name on the session DBus.   The  name
408              may have a .* suffix to match all names underneath it, including
409              itself.  The interface member may have a .* to match all members
410              of  an interface, or be * to match all interfaces.  The path may
411              have a /* suffix to indicate all objects underneath it,  includ‐
412              ing  itself.   Omitting  the interface member or the object path
413              will match all members and object paths, respectively.
414
415              Example:
416              $ firejail --dbus-user=filter --dbus-user.broadcast=\
417              org.freedesktop.Notifications=\
418              org.freedesktop.Notifications.*@/org/freedesktop/Notifications
419
420
421       --dbus-user.call=name=[member][@path]
422              Allows the application to call the indicated interface member at
423              the  indicated  object path exposed by the indicated bus name on
424              the session DBus.  The name may have a .* suffix  to  match  all
425              names underneath it, including itself.  The interface member may
426              have a .* to match all members of an interface, or be * to match
427              all  interfaces.   The path may have a /* suffix to indicate all
428              objects underneath it, including itself.  Omitting the interface
429              member  or  the  object  path  will match all members and object
430              paths, respectively.
431
432              Example:
433              $ firejail --dbus-user=filter --dbus-user.call=\
434              org.freedesktop.Notifications=\
435              org.freedesktop.Notifications.*@/org/freedesktop/Notifications
436
437
438       --dbus-user.log
439              Turn on DBus logging for the session DBus. This option  requires
440              --dbus-user=log.
441
442              Example:
443              $ firejail --dbus-user=filter --dbus-user.log
444
445
446       --dbus-user.own=name
447              Allows  the  application to own the specified well-known name on
448              the session DBus.  The name may have a .* suffix  to  match  all
449              names  underneath it, including itself (e.g. "foo.bar.*" matches
450              "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but  not  "foo‐
451              bar").
452
453              Example:
454              $ firejail --dbus-user=filter --dbus-user.own=org.gnome.ghex.*
455
456
457       --dbus-user.talk=name
458              Allows  the application to talk to the specified well-known name
459              on the session DBus.  The name may have a .* suffix to match all
460              names  underneath it, including itself (e.g. "foo.bar.*" matches
461              "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but  not  "foo‐
462              bar").
463
464              Example:
465              $ firejail --dbus-user=filter --dbus-user.talk=\
466              org.freedesktop.Notifications
467
468
469       --dbus-user.see=name
470              Allows  the  application  to  see, but not talk to the specified
471              well-known name on the session DBus.  The name  may  have  a  .*
472              suffix  to match all names underneath it, including itself (e.g.
473              "foo.bar.*"     matches     "foo.bar",     "foo.bar.baz"     and
474              "foo.bar.baz.quux", but not "foobar").
475
476              Example:
477              $ firejail --dbus-user=filter --dbus-user.see=\
478              org.freedesktop.Notifications
479
480       --debug
481              Print debug messages.
482
483              Example:
484              $ firejail --debug firefox
485
486
487       --debug-blacklists
488              Debug blacklisting.
489
490              Example:
491              $ firejail --debug-blacklists firefox
492
493
494       --debug-caps
495              Print  all recognized capabilities in the current Firejail soft‐
496              ware build and exit.
497
498              Example:
499              $ firejail --debug-caps
500
501
502       --debug-errnos
503              Print all recognized error numbers in the current Firejail soft‐
504              ware build and exit.
505
506              Example:
507              $ firejail --debug-errnos
508
509       --debug-private-lib
510              Debug messages for --private-lib option.
511
512       --debug-protocols
513              Print  all recognized protocols in the current Firejail software
514              build and exit.
515
516              Example:
517              $ firejail --debug-protocols
518
519       --debug-syscalls
520              Print all recognized system calls in the current Firejail  soft‐
521              ware build and exit.
522
523              Example:
524              $ firejail --debug-syscalls
525
526       --debug-syscalls32
527              Print all recognized 32 bit system calls in the current Firejail
528              software build and exit.
529
530       --debug-whitelists
531              Debug whitelisting.
532
533              Example:
534              $ firejail --debug-whitelists firefox
535
536       --defaultgw=address
537              Use this address as default gateway in  the  new  network  name‐
538              space.
539
540              Example:
541              $ firejail --net=eth0 --defaultgw=10.10.20.1 firefox
542
543       --disable-mnt
544              Blacklist /mnt, /media, /run/mount and /run/media access.
545
546              Example:
547              $ firejail --disable-mnt firefox
548
549
550       --deterministic-exit-code
551              Always exit firejail with the first child's exit status. The de‐
552              fault behavior is to use the exit status of the final  child  to
553              exit, which can be nondeterministic.
554
555
556       --dns=address
557              Set a DNS server for the sandbox. Up to three DNS servers can be
558              defined.  Use this option if you don't trust the  DNS  setup  on
559              your network.
560
561              Example:
562              $ firejail --dns=8.8.8.8 --dns=8.8.4.4 firefox
563
564              Note: this feature is not supported on systemd-resolved setups.
565
566       --dns.print=name|pid
567              Print  DNS  configuration for a sandbox identified by name or by
568              PID.
569
570              Example:
571              $ firejail --name=mygame --caps.drop=all warzone2100 &
572              $ firejail --dns.print=mygame
573
574              Example:
575              $ firejail --list
576              3272:netblue::firejail --private firefox
577              $ firejail --dns.print=3272
578
579
580       --env=name=value
581              Set environment variable in the new sandbox.
582
583              Example:
584              $ firejail --env=LD_LIBRARY_PATH=/opt/test/lib
585
586
587       --fs.print=name|pid
588              Print the filesystem log for the sandbox identified by  name  or
589              by PID.
590
591              Example:
592              $ firejail --name=mygame --caps.drop=all warzone2100 &
593              $ firejail --fs.print=mygame
594
595              Example:
596              $ firejail --list
597              3272:netblue::firejail --private firefox
598              $ firejail --fs.print=3272
599
600
601       --get=name|pid filename
602              Get a file from sandbox container, see FILE TRANSFER section for
603              more details.
604
605       -?, --help
606              Print options end exit.
607
608
609
610       --hostname=name
611              Set sandbox hostname.
612
613              Example:
614              $ firejail --hostname=officepc firefox
615
616
617       --hosts-file=file
618              Use file as /etc/hosts.
619
620              Example:
621              $ firejail --hosts-file=~/myhosts firefox
622
623
624       --ignore=command
625              Ignore command in profile file.
626
627              Example:
628              $ firejail --ignore=shell --ignore=seccomp firefox
629              $ firejail --ignore="net eth0" firefox
630
631
632       --interface=interface
633              Move interface in a new network namespace. Up to  four  --inter‐
634              face  options can be specified.  Note: wlan devices are not sup‐
635              ported for this option.
636
637              Example:
638              $ firejail --interface=eth1 --interface=eth0.vlan100
639
640
641       --ip=address
642              Assign IP addresses to the last network interface defined  by  a
643              --net option. A default gateway is assigned by default.
644
645              Example:
646              $ firejail --net=eth0 --ip=10.10.20.56 firefox
647
648
649       --ip=none
650              No IP address and no default gateway are configured for the last
651              interface defined by a --net option. Use this option in case you
652              intend to start an external DHCP client in the sandbox.
653
654              Example:
655              $ firejail --net=eth0 --ip=none
656
657              If  the  corresponding interface doesn't have an IP address con‐
658              figured, this option is enabled by default.
659
660
661       --ip=dhcp
662              Acquire an IP address and default gateway for the last interface
663              defined  by  a  --net option, as well as set the DNS servers ac‐
664              cording to the DHCP response.   This  option  requires  the  ISC
665              dhclient DHCP client to be installed and will start it automati‐
666              cally inside the sandbox.
667
668              Example:
669              $ firejail --net=br0 --ip=dhcp
670
671              This option should not be used in conjunction with the --dns op‐
672              tion  if the DHCP server is set to configure DNS servers for the
673              clients, because the manually  specified  DNS  servers  will  be
674              overwritten.
675
676              The DHCP client will NOT release the DHCP lease when the sandbox
677              terminates.  If your DHCP server requires leases to  be  explic‐
678              itly  released, consider running a DHCP client and releasing the
679              lease manually in conjunction with the --net=none option.
680
681
682       --ip6=address
683              Assign IPv6 addresses to the last network interface defined by a
684              --net option.
685
686              Example:
687              $ firejail --net=eth0 --ip6=2001:0db8:0:f101::1/64 firefox
688
689              Note:  you don't need this option if you obtain your ip6 address
690              from router via SLAAC (your ip6 address and default  route  will
691              be configured by kernel automatically).
692
693
694       --ip6=dhcp
695              Acquire  an IPv6 address and default gateway for the last inter‐
696              face defined by a --net option, as well as set the  DNS  servers
697              according  to  the  DHCP response.  This option requires the ISC
698              dhclient DHCP client to be installed and will start it automati‐
699              cally inside the sandbox.
700
701              Example:
702              $ firejail --net=br0 --ip6=dhcp
703
704              This option should not be used in conjunction with the --dns op‐
705              tion if the DHCP server is set to configure DNS servers for  the
706              clients,  because  the  manually  specified  DNS servers will be
707              overwritten.
708
709              The DHCP client will NOT release the DHCP lease when the sandbox
710              terminates.   If  your DHCP server requires leases to be explic‐
711              itly released, consider running a DHCP client and releasing  the
712              lease manually.
713
714
715       --iprange=address,address
716              Assign  an  IP address in the provided range to the last network
717              interface defined by a --net option. A default  gateway  is  as‐
718              signed by default.
719
720              Example:
721              $ firejail --net=eth0 --iprange=192.168.1.100,192.168.1.150
722
723
724       --ipc-namespace
725              Enable  a new IPC namespace if the sandbox was started as a reg‐
726              ular user. IPC namespace is enabled  by  default  for  sandboxes
727              started as root.
728
729              Example:
730              $ firejail --ipc-namespace firefox
731
732       --join=name|pid
733              Join  the  sandbox  identified  by  name or by PID. By default a
734              /bin/bash shell is started after joining the sandbox.  If a pro‐
735              gram  is specified, the program is run in the sandbox. If --join
736              command is issued as a regular user, all  security  filters  are
737              configured  for  the new process the same they are configured in
738              the sandbox.  If --join command is issued as root, the  security
739              filters,  cgroups and cpus configurations are not applied to the
740              process joining the sandbox.
741
742              Example:
743              $ firejail --name=mygame --caps.drop=all warzone2100 &
744              $ firejail --join=mygame
745
746              Example:
747              $ firejail --list
748              3272:netblue::firejail --private firefox
749              $ firejail --join=3272
750
751
752       --join-filesystem=name|pid
753              Join the mount namespace of the sandbox identified  by  name  or
754              PID.  By  default a /bin/bash shell is started after joining the
755              sandbox.  If a program is specified, the program is run  in  the
756              sandbox.  This command is available only to root user.  Security
757              filters, cgroups and cpus configurations are not applied to  the
758              process joining the sandbox.
759
760       --join-network=name|pid
761              Join the network namespace of the sandbox identified by name. By
762              default a /bin/bash shell is started after joining the  sandbox.
763              If  a  program  is specified, the program is run in the sandbox.
764              This command is available only to root user.  Security  filters,
765              cgroups  and  cpus configurations are not applied to the process
766              joining the sandbox. Example:
767
768              # start firefox
769              $ firejail --net=eth0 --name=browser firefox &
770
771              # change netfilter configuration
772              $ sudo firejail --join-network=browser bash -c  "cat  /etc/fire‐
773              jail/nolocal.net | /sbin/iptables-restore"
774
775              # verify netfilter configuration
776              $ sudo firejail --join-network=browser /sbin/iptables -vL
777
778              # verify  IP addresses
779              $ sudo firejail --join-network=browser ip addr
780              Switching  to pid 1932, the first child process inside the sand‐
781              box
782              1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state  UN‐
783              KNOWN group default
784                  link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
785                  inet 127.0.0.1/8 scope host lo
786                     valid_lft forever preferred_lft forever
787                  inet6 ::1/128 scope host
788                     valid_lft forever preferred_lft forever
789              2:  eth0-1931:  <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
790              noqueue state UNKNOWN group default
791                  link/ether 76:58:14:42:78:e4 brd ff:ff:ff:ff:ff:ff
792                  inet  192.168.1.158/24  brd   192.168.1.255   scope   global
793              eth0-1931
794                     valid_lft forever preferred_lft forever
795                  inet6 fe80::7458:14ff:fe42:78e4/64 scope link
796                     valid_lft forever preferred_lft forever
797
798       --join-or-start=name
799              Join the sandbox identified by name or start a new one.  Same as
800              "firejail --join=name" if sandbox with  specified  name  exists,
801              otherwise same as "firejail --name=name ..."
802              Note  that in contrary to other join options there is respective
803              profile option.
804
805
806       --keep-dev-shm
807              /dev/shm directory is untouched (even with --private-dev)
808
809              Example:
810              $ firejail --keep-dev-shm --private-dev
811
812
813       --keep-var-tmp
814              /var/tmp directory is untouched.
815
816              Example:
817              $ firejail --keep-var-tmp
818
819
820       --list List all sandboxes, see MONITORING section for more details.
821
822              Example:
823              $ firejail --list
824              7015:netblue:browser:firejail firefox
825              7056:netblue:torrent:firejail --net=eth0 transmission-gtk
826              7064:netblue::firejail --noroot xterm
827
828       --ls=name|pid dir_or_filename
829              List files in sandbox container, see FILE TRANSFER  section  for
830              more details.
831
832       --mac=address
833              Assign  MAC addresses to the last network interface defined by a
834              --net option. This option is not supported for  wireless  inter‐
835              faces.
836
837              Example:
838              $ firejail --net=eth0 --mac=00:11:22:33:44:55 firefox
839
840       --machine-id
841              Spoof  id  number  in  /etc/machine-id file - a new random id is
842              generated inside the sandbox.  Note that this breaks audio  sup‐
843              port. Enable it when sound is not required.
844
845              Example:
846              $ firejail --machine-id
847
848
849       --memory-deny-write-execute
850              Install a seccomp filter to block attempts to create memory map‐
851              pings that are both writable and executable, to change  mappings
852              to  be  executable,  or  to create executable shared memory. The
853              filter  examines  the  arguments  of  mmap,   mmap2,   mprotect,
854              pkey_mprotect,  memfd_create  and shmat system calls and returns
855              error EPERM to the process (or kills it or log the attempt,  see
856              --seccomp-error-action below) if necessary.
857
858              Note:  shmat  is  not implemented as a system call on some plat‐
859              forms including i386, and it cannot be handled by seccomp-bpf.
860
861       --mtu=number
862              Assign a MTU value to the last network interface  defined  by  a
863              --net option.
864
865              Example:
866              $ firejail --net=eth0 --mtu=1492
867
868       --name=name
869              Set  sandbox  name.  Several options, such as --join and --shut‐
870              down, can use this name to identify a sandbox.
871
872              In case the name supplied by the user is already in use  by  an‐
873              other  sandbox,  Firejail  will assign a new name as "name-PID",
874              where PID is the process ID of the sandbox.  This  functionality
875              can  be  disabled  at  run time in /etc/firejail/firejail.config
876              file, by setting "name-change" flag to "no".
877
878              Example:
879              $ firejail --name=browser firefox &
880              $ firejail --name=browser --private firefox --no-remote &
881              $ firejail --list
882              1198:netblue:browser:firejail --name=browser firefox
883              1312:netblue:browser-1312:firejail   --name=browser    --private
884              firefox --no-remote
885
886       --net=bridge_interface
887              Enable a new network namespace and connect it to this bridge in‐
888              terface.  Unless specified with option --ip and --defaultgw,  an
889              IP  address and a default gateway will be assigned automatically
890              to the sandbox. The IP address is verified using ARP before  as‐
891              signment.  The  address  configured  as  default  gateway is the
892              bridge device IP address. Up to four --net options can be speci‐
893              fied.
894
895              Example:
896              $ sudo brctl addbr br0
897              $ sudo ifconfig br0 10.10.20.1/24
898              $ sudo brctl addbr br1
899              $ sudo ifconfig br1 10.10.30.1/24
900              $ firejail --net=br0 --net=br1
901
902
903       --net=ethernet_interface|wireless_interface
904              Enable  a  new network namespace and connect it to this ethernet
905              interface using the standard Linux macvlan|ipvaln driver. Unless
906              specified  with option --ip and --defaultgw, an IP address and a
907              default gateway will be assigned automatically to  the  sandbox.
908              The  IP address is verified using ARP before assignment. The ad‐
909              dress configured as default gateway is the  default  gateway  of
910              the  host.  Up  to four --net options can be specified.  Support
911              for ipvlan driver was introduced in Linux kernel 3.19.
912
913              Example:
914              $ firejail --net=eth0 --ip=192.168.1.80 --dns=8.8.8.8 firefox
915              $ firejail --net=wlan0 firefox
916
917       --net=none
918              Enable a new, unconnected network namespace. The only  interface
919              available in the new namespace is a new loopback interface (lo).
920              Use this option to deny network access to  programs  that  don't
921              really need network access.
922
923              Example:
924              $ firejail --net=none vlc
925
926              Note:  --net=none  can  crash the application on some platforms.
927              In these cases, it can be replaced with --protocol=unix.
928
929       --net=tap_interface
930              Enable a new network namespace and connect it to  this  ethernet
931              tap  interface  using  the standard Linux macvlan driver. If the
932              tap interface is not configured, the sandbox  will  not  try  to
933              configure  the  interface  inside the sandbox.  Please use --ip,
934              --netmask and --defaultgw to specify the configuration.
935
936              Example:
937              $ firejail --net=tap0  --ip=10.10.20.80  --netmask=255.255.255.0
938              --defaultgw=10.10.20.1 firefox
939
940
941       --net.print=name|pid
942              If  a  new network namespace is enabled, print network interface
943              configuration for the sandbox specified by name or PID. Example:
944
945              $ firejail --net.print=browser
946              Switching to pid 1853, the first child process inside the  sand‐
947              box
948              Interface  MAC               IP            Mask        Status
949              lo                           127.0.0.1     255.0.0.0     UP
950              eth0-1852  5e:fb:8e:27:29:26 192.168.1.186 255.255.255.0 UP
951
952
953       --netfilter
954              Enable  a default firewall if a new network namespace is created
955              inside the sandbox.  This option has no effect for sandboxes us‐
956              ing the system network namespace.
957
958              The  default  firewall is optimized for regular desktop applica‐
959              tions. No incoming connections are accepted:
960
961              *filter
962              :INPUT DROP [0:0]
963              :FORWARD DROP [0:0]
964              :OUTPUT ACCEPT [0:0]
965              -A INPUT -i lo -j ACCEPT
966              -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
967              # allow ping
968              -A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT
969              -A INPUT -p icmp --icmp-type time-exceeded -j ACCEPT
970              -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
971              # drop STUN (WebRTC) requests
972              -A OUTPUT -p udp --dport 3478 -j DROP
973              -A OUTPUT -p udp --dport 3479 -j DROP
974              -A OUTPUT -p tcp --dport 3478 -j DROP
975              -A OUTPUT -p tcp --dport 3479 -j DROP
976              COMMIT
977
978              Example:
979              $ firejail --net=eth0 --netfilter firefox
980
981       --netfilter=filename
982              Enable the firewall specified by filename if a new network name‐
983              space  is created inside the sandbox.  This option has no effect
984              for sandboxes using the system network namespace.
985
986              Please use the regular iptables-save/iptables-restore format for
987              the  filter  file.  The  following  examples  are  available  in
988              /etc/firejail directory:
989
990              webserver.net is a webserver firewall that allows access only to
991              TCP ports 80 and 443.  Example:
992
993              $ firejail --netfilter=/etc/firejail/webserver.net --net=eth0 \
994              /etc/init.d/apache2 start
995
996              nolocal.net/nolocal6.net  is a desktop client firewall that dis‐
997              able access to local network. Example:
998
999              $ firejail --netfilter=/etc/firejail/nolocal.net \
1000              --net=eth0 firefox
1001
1002
1003       --netfilter=filename,arg1,arg2,arg3 ...
1004              This is the template version of  the  previous  command.  $ARG1,
1005              $ARG2,  $ARG3 ... in the firewall script are replaced with arg1,
1006              arg2, arg3 ... passed on the command line. Up  to  16  arguments
1007              are supported.  Example:
1008
1009              $ firejail --net=eth0 --ip=192.168.1.105 \
1010              --netfilter=/etc/firejail/tcpserver.net,5001 server-program
1011
1012
1013       --netfilter.print=name|pid
1014              Print the firewall installed in the sandbox specified by name or
1015              PID. Example:
1016
1017              $ firejail --name=browser --net=eth0 --netfilter firefox &
1018              $ firejail --netfilter.print=browser
1019
1020
1021       --netfilter6=filename
1022              Enable the IPv6 firewall specified by filename if a new  network
1023              namespace is created inside the sandbox.  This option has no ef‐
1024              fect for sandboxes using the system network  namespace.   Please
1025              use  the  regular  iptables-save/iptables-restore format for the
1026              filter file.
1027
1028
1029       --netfilter6.print=name|pid
1030              Print the IPv6 firewall installed in the  sandbox  specified  by
1031              name or PID. Example:
1032
1033              $ firejail --name=browser --net=eth0 --netfilter firefox &
1034              $ firejail --netfilter6.print=browser
1035
1036
1037       --netmask=address
1038              Use  this  option when you want to assign an IP address in a new
1039              namespace and the parent interface specified  by  --net  is  not
1040              configured.  An  IP  address  and a default gateway address also
1041              have to be added. By default the new namespace  interface  comes
1042              without IP address and default gateway configured. Example:
1043
1044              $ sudo /sbin/brctl addbr br0
1045              $ sudo /sbin/ifconfig br0 up
1046              $   firejail   --ip=10.10.20.67   --netmask=255.255.255.0  --de‐
1047              faultgw=10.10.20.1
1048
1049
1050       --netns=name
1051              Run the program in a named, persistent network namespace.  These
1052              can be created and configured using "ip netns".
1053
1054
1055       --netstats
1056              Monitor network namespace statistics, see MONITORING section for
1057              more details.
1058
1059              Example:
1060
1061              $ firejail --netstats
1062              PID  User    RX(KB/s) TX(KB/s) Command
1063              1294 netblue 53.355   1.473    firejail --net=eth0 firefox
1064              7383 netblue 9.045    0.112    firejail --net=eth0 transmission
1065
1066       --nice=value
1067              Set nice value for all processes  running  inside  the  sandbox.
1068              Only root may specify a negative value.
1069
1070              Example:
1071              $ firejail --nice=2 firefox
1072
1073
1074       --no3d Disable 3D hardware acceleration.
1075
1076              Example:
1077              $ firejail --no3d firefox
1078
1079
1080       --noautopulse
1081              Disable  automatic ~/.config/pulse init, for complex setups such
1082              as remote pulse servers or non-standard socket paths.
1083
1084              Example:
1085              $ firejail --noautopulse firefox
1086
1087
1088       --noblacklist=dirname_or_filename
1089              Disable blacklist for this directory or file.
1090
1091              Example:
1092              $ firejail
1093              $ nc dict.org 2628
1094              bash: /bin/nc: Permission denied
1095              $ exit
1096
1097              $ firejail --noblacklist=/bin/nc
1098              $ nc dict.org 2628
1099              220 pan.alephnull.com dictd 1.12.1/rf on Linux 3.14-1-amd64
1100
1101       --nodbus (deprecated)
1102              Disable D-Bus access (both system and session buses). Equivalent
1103              to --dbus-system=none --dbus-user=none.
1104
1105              Example:
1106              $ firejail --nodbus --net=none
1107
1108       --nodvd
1109              Disable DVD and audio CD devices.
1110
1111              Example:
1112              $ firejail --nodvd
1113
1114       --noexec=dirname_or_filename
1115              Remount  directory  or file noexec, nodev and nosuid. File glob‐
1116              bing is supported, see FILE GLOBBING section for more details.
1117
1118              Example:
1119              $ firejail --noexec=/tmp
1120
1121              /etc and /var are noexec by default if the sandbox  was  started
1122              as a regular user.
1123
1124
1125       --nogroups
1126              Disable supplementary groups. Without this option, supplementary
1127              groups are enabled for the user starting the sandbox.  For  root
1128              user supplementary groups are always disabled.
1129
1130              Note:  By  default  all regular user groups are removed with the
1131              exception of the current user. This can be changed  using  --al‐
1132              lusers command option.
1133
1134              Example:
1135              $ id
1136              uid=1000(netblue)       gid=1000(netblue)       groups=1000(net‐
1137              blue),24(cdrom),25(floppy),27(sudo),29(audio)
1138              $ firejail --nogroups
1139              Parent pid 8704, child pid 8705
1140              Child process initialized
1141              $ id
1142              uid=1000(netblue) gid=1000(netblue) groups=1000(netblue)
1143              $
1144
1145
1146       --nonewprivs
1147              Sets the NO_NEW_PRIVS prctl.  This ensures that child  processes
1148              cannot  acquire  new privileges using execve(2);  in particular,
1149              this means that calling a suid binary (or one with file capabil‐
1150              ities)  does not result in an increase of privilege. This option
1151              is enabled by default if seccomp filter is activated.
1152
1153
1154       --noprofile
1155              Do not use a security profile.
1156
1157              Example:
1158              $ firejail
1159              Reading profile /etc/firejail/default.profile
1160              Parent pid 8553, child pid 8554
1161              Child process initialized
1162              [...]
1163
1164              $ firejail --noprofile
1165              Parent pid 8553, child pid 8554
1166              Child process initialized
1167              [...]
1168
1169       --noroot
1170              Install a user namespace with a single user - the current  user.
1171              root  user  does not exist in the new namespace. This option re‐
1172              quires a Linux kernel version 3.8 or newer. The  option  is  not
1173              supported  for  --chroot  and  --overlay  configurations, or for
1174              sandboxes started as root.
1175
1176              Example:
1177              $ firejail --noroot
1178              Parent pid 8553, child pid 8554
1179              Child process initialized
1180              $ ping google.com
1181              ping: icmp open socket: Operation not permitted
1182              $
1183
1184       --nosound
1185              Disable sound system.
1186
1187              Example:
1188              $ firejail --nosound firefox
1189
1190
1191       --notv Disable DVB (Digital Video Broadcasting) TV devices.
1192
1193              Example:
1194              $ firejail --notv vlc
1195
1196
1197       --nou2f
1198              Disable U2F devices.
1199
1200              Example:
1201              $ firejail --nou2f
1202
1203
1204       --novideo
1205              Disable video devices.
1206
1207
1208       --nowhitelist=dirname_or_filename
1209              Disable whitelist for this directory or file.
1210
1211
1212       --output=logfile
1213              stdout logging and log rotation. Copy  stdout  to  logfile,  and
1214              keep  the  size of the file under 500KB using log rotation. Five
1215              files with prefixes .1 to .5 are used in rotation.
1216
1217              Example:
1218              $ firejail --output=sandboxlog /bin/bash
1219              [...]
1220              $ ls -l sandboxlog*
1221              -rw-r--r-- 1 netblue netblue 333890 Jun  2 07:48 sandboxlog
1222              -rw-r--r-- 1 netblue netblue 511488 Jun  2 07:48 sandboxlog.1
1223              -rw-r--r-- 1 netblue netblue 511488 Jun  2 07:48 sandboxlog.2
1224              -rw-r--r-- 1 netblue netblue 511488 Jun  2 07:48 sandboxlog.3
1225              -rw-r--r-- 1 netblue netblue 511488 Jun  2 07:48 sandboxlog.4
1226              -rw-r--r-- 1 netblue netblue 511488 Jun  2 07:48 sandboxlog.5
1227
1228
1229       --output-stderr=logfile
1230              Similar to --output, but stderr is also stored.
1231
1232
1233       --private
1234              Mount new /root and /home/user directories in temporary filesys‐
1235              tems.  All  modifications  are  discarded  when  the  sandbox is
1236              closed.
1237
1238              Example:
1239              $ firejail --private firefox
1240
1241
1242       --private=directory
1243              Use directory as user home.  --private  and  --private=directory
1244              cannot be used together.
1245
1246              Example:
1247              $ firejail --private=/home/netblue/firefox-home firefox
1248
1249
1250       --private-bin=file,file
1251              Build  a  new  /bin in a temporary filesystem, and copy the pro‐
1252              grams in the list.  The files in the list must be  expressed  as
1253              relative  to  the  /bin, /sbin, /usr/bin, /usr/sbin, or /usr/lo‐
1254              cal/bin directories.  If no listed files are found, /bin  direc‐
1255              tory  will  be  empty.   The same directory is also bind-mounted
1256              over /sbin, /usr/bin, /usr/sbin and /usr/local/bin.  All modifi‐
1257              cations  are discarded when the sandbox is closed. File globbing
1258              is supported, see FILE GLOBBING section for more details.
1259
1260              Example:
1261              $ firejail --private-bin=bash,sed,ls,cat
1262              Parent pid 20841, child pid 20842
1263              Child process initialized
1264              $ ls /bin
1265              bash  cat  ls  sed
1266
1267
1268       --private-cache
1269              Mount an empty temporary filesystem on top of the .cache  direc‐
1270              tory  in  user  home.  All  modifications are discarded when the
1271              sandbox is closed.
1272
1273              Example:
1274              $ firejail --private-cache openbox
1275
1276
1277       --private-cwd
1278              Set working directory inside jail to  the  home  directory,  and
1279              failing that, the root directory.
1280              Does not impact working directory of profile include paths.
1281
1282              Example:
1283              $ pwd
1284              /tmp
1285              $ firejail --private-cwd
1286              $ pwd
1287              /home/user
1288
1289
1290       --private-cwd=directory
1291              Set working directory inside the jail.
1292              Does not impact working directory of profile include paths.
1293
1294              Example:
1295              $ pwd
1296              /tmp
1297              $ firejail --private-cwd=/opt
1298              $ pwd
1299              /opt
1300
1301
1302       --private-dev
1303              Create  a new /dev directory. Only disc, dri, dvb, hidraw, null,
1304              full, zero, tty, pts, ptmx, random, snd,  urandom,  video,  log,
1305              shm  and  usb  devices  are  available.  Use the options --no3d,
1306              --nodvd, --nosound, --notv, --nou2f and --novideo for additional
1307              restrictions.
1308
1309              Example:
1310              $ firejail --private-dev
1311              Parent pid 9887, child pid 9888
1312              Child process initialized
1313              $ ls /dev
1314              cdrom  cdrw  dri  dvd  dvdrw  full  log  null  ptmx  pts  random
1315              shm  snd  sr0  tty  urandom  zero
1316              $
1317
1318       --private-etc=file,directory
1319              Build a new /etc in a temporary filesystem, and copy  the  files
1320              and  directories  in the list.  The files and directories in the
1321              list must be expressed as relative to the /etc directory.  If no
1322              listed file is found, /etc directory will be empty.  All modifi‐
1323              cations are discarded when the sandbox is closed.
1324
1325              Example:
1326              $ firejail --private-etc=group,hostname,localtime, \
1327              nsswitch.conf,passwd,resolv.conf,default/motd-news
1328
1329       --private-home=file,directory
1330              Build a new user home in a temporary filesystem,  and  copy  the
1331              files  and  directories  in the list in the new home.  The files
1332              and directories in the list must be expressed as relative to the
1333              current  user's home directory.  All modifications are discarded
1334              when the sandbox is closed.
1335
1336              Example:
1337              $ firejail --private-home=.mozilla firefox
1338
1339       --private-lib=file,directory
1340              This feature is currently under heavy  development.  Only  amd64
1341              platforms  are supported at this moment.  The files and directo‐
1342              ries in the list must be expressed as relative to the  /lib  di‐
1343              rectory.   The  idea  is  to  build  a  new  /lib in a temporary
1344              filesystem, with only the library files necessary to run the ap‐
1345              plication.  It could be as simple as:
1346
1347              $ firejail --private-lib galculator
1348
1349              but it gets complicated really fast:
1350
1351              $    firejail   --private-lib=x86_64-linux-gnu/xed,x86_64-linux-
1352              gnu/gdk-pixbuf-2.0,libenchant.so.1,librsvg-2.so.2 xed
1353
1354              The feature is integrated with --private-bin:
1355
1356              $ firejail --private-lib --private-bin=bash,ls,ps
1357              $ ls /lib
1358              ld-linux-x86-64.so.2  libgpg-error.so.0  libprocps.so.6  libsys‐
1359              temd.so.0
1360              libc.so.6 liblz4.so.1 libpthread.so.0 libtinfo.so.5
1361              libdl.so.2 liblzma.so.5 librt.so.1 x86_64-linux-gnu
1362              libgcrypt.so.20 libpcre.so.3 libselinux.so.1
1363              $ ps
1364               PID TTY          TIME CMD
1365                  1 pts/0    00:00:00 firejail
1366                 45 pts/0    00:00:00 bash
1367                 48 pts/0    00:00:00 ps
1368              $
1369
1370
1371       --private-opt=file,directory
1372              Build  a  new /opt in a temporary filesystem, and copy the files
1373              and directories in the list.  The files and directories  in  the
1374              list must be expressed as relative to the /opt directory.  If no
1375              listed file is found, /opt directory will be empty.  All modifi‐
1376              cations are discarded when the sandbox is closed.
1377
1378              Example:
1379              $ firejail --private-opt=firefox /opt/firefox/firefox
1380
1381
1382       --private-srv=file,directory
1383              Build  a  new /srv in a temporary filesystem, and copy the files
1384              and directories in the list.  The files and directories  in  the
1385              list must be expressed as relative to the /srv directory.  If no
1386              listed file is found, /srv directory will be empty.  All modifi‐
1387              cations are discarded when the sandbox is closed.
1388
1389              Example:
1390              # firejail --private-srv=www /etc/init.d/apache2 start
1391
1392
1393       --private-tmp
1394              Mount  an  empty  temporary  filesystem on top of /tmp directory
1395              whitelisting X11 and PulseAudio sockets.
1396
1397              Example:
1398              $ firejail --private-tmp
1399              $ ls -al /tmp
1400              drwxrwxrwt  4 nobody nogroup   80 Apr 30 11:46 .
1401              drwxr-xr-x 30 nobody nogroup 4096 Apr 26 22:18 ..
1402              drwx------  2  nobody  nogroup  4096  Apr  30  10:52  pulse-PKd‐
1403              htXMmr18n
1404              drwxrwxrwt  2 nobody nogroup 4096 Apr 30 10:52 .X11-unix
1405
1406
1407       --profile=filename_or_profilename
1408              Load  a  custom security profile from filename. For filename use
1409              an absolute path or a path relative to the  current  path.   For
1410              more information, see SECURITY PROFILES section below.
1411
1412              Example:
1413              $ firejail --profile=myprofile
1414
1415
1416       --profile.print=name|pid
1417              Print the name of the profile file for the sandbox identified by
1418              name or or PID.
1419
1420              Example:
1421              $ firejail --profile.print=browser
1422              /etc/firejail/firefox.profile
1423
1424       --protocol=protocol,protocol,protocol
1425              Enable protocol filter. The  filter  is  based  on  seccomp  and
1426              checks  the  first  argument  to socket system call.  Recognized
1427              values: unix, inet, inet6, netlink, packet and  bluetooth.  This
1428              option is not supported for i386 architecture.
1429
1430              Example:
1431              $ firejail --protocol=unix,inet,inet6 firefox
1432
1433       --protocol.print=name|pid
1434              Print  the protocol filter for the sandbox identified by name or
1435              PID.
1436
1437              Example:
1438              $ firejail --name=mybrowser firefox &
1439              $ firejail --protocol.print=mybrowser
1440              unix,inet,inet6,netlink
1441
1442              Example:
1443              $ firejail --list
1444              3272:netblue::firejail --private firefox
1445              $ firejail --protocol.print=3272
1446              unix,inet,inet6,netlink
1447
1448       --put=name|pid src-filename dest-filename
1449              Put a file in sandbox container, see FILE TRANSFER  section  for
1450              more details.
1451
1452       --quiet
1453              Turn off Firejail's output.
1454
1455              The  same effect can be obtained by setting an environment vari‐
1456              able FIREJAIL_QUIET to yes.
1457
1458       --read-only=dirname_or_filename
1459              Set directory or file read-only. File globbing is supported, see
1460              FILE GLOBBING section for more details.
1461
1462              Example:
1463              $ firejail --read-only=~/.mozilla firefox
1464
1465       --read-write=dirname_or_filename
1466              Set  directory or file read-write. Only files or directories be‐
1467              longing to the current user are allowed for this operation. File
1468              globbing  is  supported,  see FILE GLOBBING section for more de‐
1469              tails.  Example:
1470
1471              $ mkdir ~/test
1472              $ touch ~/test/a
1473              $ firejail --read-only=~/test --read-write=~/test/a
1474
1475
1476
1477       --rlimit-as=number
1478              Set the maximum size of the process's  virtual  memory  (address
1479              space) in bytes.
1480
1481
1482       --rlimit-cpu=number
1483              Set  the  maximum  limit, in seconds, for the amount of CPU time
1484              each sandboxed process  can consume. When the limit is  reached,
1485              the processes are killed.
1486
1487              The  CPU  limit  is  a  limit on CPU seconds rather than elapsed
1488              time. CPU seconds is basically how many seconds the CPU has been
1489              in  use  and does not necessarily directly relate to the elapsed
1490              time. Linux kernel keeps track of CPU seconds for  each  process
1491              independently.
1492
1493
1494       --rlimit-fsize=number
1495              Set the maximum file size that can be created by a process.
1496
1497       --rlimit-nofile=number
1498              Set the maximum number of files that can be opened by a process.
1499
1500       --rlimit-nproc=number
1501              Set  the maximum number of processes that can be created for the
1502              real user ID of the calling process.
1503
1504       --rlimit-sigpending=number
1505              Set the maximum number of pending signals for a process.
1506
1507
1508       --rmenv=name
1509              Remove environment variable in the new sandbox.
1510
1511              Example:
1512              $ firejail --rmenv=DBUS_SESSION_BUS_ADDRESS
1513
1514       --scan ARP-scan all the networks from inside a network namespace.  This
1515              makes  it  possible to detect macvlan kernel device drivers run‐
1516              ning on the current host.
1517
1518              Example:
1519              $ firejail --net=eth0 --scan
1520
1521       --seccomp
1522              Enable seccomp filter and blacklist the syscalls in the  default
1523              list,  which  is  @default-nodebuggers unless allow-debuggers is
1524              specified, then it is @default.
1525
1526              To help creating useful seccomp filters more easily, the follow‐
1527              ing  system  call  groups  are defined: @aio, @basic-io, @chown,
1528              @clock, @cpu-emulation, @debug, @default,  @default-nodebuggers,
1529              @default-keep,  @file-system,  @io-event,  @ipc, @keyring, @mem‐
1530              lock,  @module,  @mount,  @network-io,  @obsolete,  @privileged,
1531              @process,  @raw-io,  @reboot, @resources, @setuid, @swap, @sync,
1532              @system-service and @timer.  More information about  groups  can
1533              be found in /usr/share/doc/firejail/syscalls.txt
1534
1535              In  addition,  a  system call can be specified by its number in‐
1536              stead of name with prefix $, so for example $165 would be  equal
1537              to mount on i386.  Exceptions can be allowed with prefix !.
1538
1539              System  architecture  is  strictly  imposed  only if flag --sec‐
1540              comp.block-secondary is used. The filter is applied at run  time
1541              only  if  the correct architecture was detected. For the case of
1542              I386 and AMD64 both 32-bit and 64-bit filters are installed.  On
1543              a  64  bit  architecture, an additional filter for 32 bit system
1544              calls can be installed with --seccomp.32.
1545
1546              Firejail will print seccomp violations to the audit log  if  the
1547              kernel was compiled with audit support (CONFIG_AUDIT flag).
1548
1549              Example:
1550              $ firejail --seccomp
1551
1552       --seccomp=syscall,@group,!syscall2
1553              Enable  seccomp  filter, whitelist "syscall2", but blacklist the
1554              default list and the syscalls or syscall groups specified by the
1555              command.
1556
1557              Example:
1558              $ firejail --seccomp=utime,utimensat,utimes firefox
1559              $ firejail --seccomp=@clock,mkdir,unlinkat transmission-gtk
1560
1561              Instead  of dropping the syscall by returning EPERM, another er‐
1562              ror number can be returned using syscall:errno syntax. This  can
1563              be  also  changed  globally  with  --seccomp-error-action  or in
1564              /etc/firejail/firejail.config file.  The  process  can  also  be
1565              killed  by  using  syscall:kill  syntax,  or  the attempt may be
1566              logged with syscall:log.
1567
1568              Example: $ firejail --seccomp=unlinkat:ENOENT,utimensat,utimes
1569              Parent pid 10662, child pid 10663
1570              Child process initialized
1571              $ touch testfile
1572              $ rm testfile
1573              rm: cannot remove `testfile': Operation not permitted
1574
1575              If the blocked system calls would also block Firejail from oper‐
1576              ating, they are handled by adding a preloaded library which per‐
1577              forms seccomp system calls later. However, this is  incompatible
1578              with 32 bit seccomp filters.
1579
1580              Example:
1581              $ firejail --noprofile --shell=none --seccomp=execve bash
1582              Parent pid 32751, child pid 32752
1583              Post-exec seccomp protector enabled
1584              list  in:  execve,  check  list:  @default-keep prelist: (null),
1585              postlist: execve
1586              Child process initialized in 46.44 ms
1587              $ ls
1588              Bad system call
1589
1590
1591       --seccomp.block-secondary
1592              Enable seccomp filter and filter system  call  architectures  so
1593              that  only  the  native architecture is allowed. For example, on
1594              amd64, i386 and x32 system calls are blocked as well as changing
1595              the execution domain with personality(2) system call.
1596
1597
1598       --seccomp.drop=syscall,@group
1599              Enable seccomp filter, and blacklist the syscalls or the syscall
1600              groups specified by the command. On a 64  bit  architecture,  an
1601              additional  filter for 32 bit system calls can be installed with
1602              --seccomp.32.drop.
1603
1604              Example:
1605              $ firejail --seccomp.drop=utime,utimensat,utimes,@clock
1606
1607              Instead of dropping the syscall by returning EPERM, another  er‐
1608              ror  number can be returned using syscall:errno syntax. This can
1609              be also  changed  globally  with  --seccomp-error-action  or  in
1610              /etc/firejail/firejail.config  file.   The  process  can also be
1611              killed by using syscall:kill  syntax,  or  the  attempt  may  be
1612              logged with syscall:log.
1613
1614              Example:
1615              $ firejail --seccomp.drop=unlinkat:ENOENT,utimensat,utimes
1616              Parent pid 10662, child pid 10663
1617              Child process initialized
1618              $ touch testfile
1619              $ rm testfile
1620              rm: cannot remove `testfile': Operation not permitted
1621
1622
1623
1624
1625
1626
1627       --seccomp.keep=syscall,@group,!syscall2
1628              Enable  seccomp  filter,  blacklist  all  syscall not listed and
1629              "syscall2".  The system calls needed  by  Firejail  (group  @de‐
1630              fault-keep:  prctl,  execve,  execveat)  are  handled  with  the
1631              preload library. On a 64 bit architecture, an additional  filter
1632              for 32 bit system calls can be installed with --seccomp.32.keep.
1633
1634              Example:
1635              $  firejail --shell=none --seccomp.keep=poll,select,[...] trans‐
1636              mission-gtk
1637
1638
1639       --seccomp.print=name|pid
1640              Print the seccomp filter for the sandbox identified by  name  or
1641              PID.
1642
1643              Example:
1644              $ firejail --name=browser firefox &
1645              $ firejail --seccomp.print=browser
1646               line  OP JT JF    K
1647              =================================
1648               0000: 20 00 00 00000004   ld  data.architecture
1649               0001: 15 01 00 c000003e   jeq ARCH_64 0003 (false 0002)
1650               0002: 06 00 00 7fff0000   ret ALLOW
1651               0003: 20 00 00 00000000   ld  data.syscall-number
1652               0004: 35 01 00 40000000   jge X32_ABI true:0006 (false 0005)
1653               0005: 35 01 00 00000000   jge read 0007 (false 0006)
1654               0006: 06 00 00 00050001   ret ERRNO(1)
1655               0007: 15 41 00 0000009a   jeq modify_ldt 0049 (false 0008)
1656               0008: 15 40 00 000000d4   jeq lookup_dcookie 0049 (false 0009)
1657               0009: 15 3f 00 0000012a   jeq perf_event_open 0049 (false 000a)
1658               000a:  15  3e  00  00000137   jeq process_vm_writev 0049 (false
1659              000b)
1660               000b: 15 3d 00 0000009c   jeq _sysctl 0049 (false 000c)
1661               000c: 15 3c 00 000000b7   jeq afs_syscall 0049 (false 000d)
1662               000d: 15 3b 00 000000ae   jeq create_module 0049 (false 000e)
1663               000e: 15 3a 00 000000b1   jeq get_kernel_syms 0049 (false 000f)
1664               000f: 15 39 00 000000b5   jeq getpmsg 0049 (false 0010)
1665               0010: 15 38 00 000000b6   jeq putpmsg 0049 (false 0011)
1666               0011: 15 37 00 000000b2   jeq query_module 0049 (false 0012)
1667               0012: 15 36 00 000000b9   jeq security 0049 (false 0013)
1668               0013: 15 35 00 0000008b   jeq sysfs 0049 (false 0014)
1669               0014: 15 34 00 000000b8   jeq tuxcall 0049 (false 0015)
1670               0015: 15 33 00 00000086   jeq uselib 0049 (false 0016)
1671               0016: 15 32 00 00000088   jeq ustat 0049 (false 0017)
1672               0017: 15 31 00 000000ec   jeq vserver 0049 (false 0018)
1673               0018: 15 30 00 0000009f   jeq adjtimex 0049 (false 0019)
1674               0019: 15 2f 00 00000131   jeq clock_adjtime 0049 (false 001a)
1675               001a: 15 2e 00 000000e3   jeq clock_settime 0049 (false 001b)
1676               001b: 15 2d 00 000000a4   jeq settimeofday 0049 (false 001c)
1677               001c: 15 2c 00 000000b0   jeq delete_module 0049 (false 001d)
1678               001d: 15 2b 00 00000139   jeq finit_module 0049 (false 001e)
1679               001e: 15 2a 00 000000af   jeq init_module 0049 (false 001f)
1680               001f: 15 29 00 000000ad   jeq ioperm 0049 (false 0020)
1681               0020: 15 28 00 000000ac   jeq iopl 0049 (false 0021)
1682               0021: 15 27 00 000000f6   jeq kexec_load 0049 (false 0022)
1683               0022: 15 26 00 00000140   jeq kexec_file_load 0049 (false 0023)
1684               0023: 15 25 00 000000a9   jeq reboot 0049 (false 0024)
1685               0024: 15 24 00 000000a7   jeq swapon 0049 (false 0025)
1686               0025: 15 23 00 000000a8   jeq swapoff 0049 (false 0026)
1687               0026: 15 22 00 000000a3   jeq acct 0049 (false 0027)
1688               0027: 15 21 00 00000141   jeq bpf 0049 (false 0028)
1689               0028: 15 20 00 000000a1   jeq chroot 0049 (false 0029)
1690               0029: 15 1f 00 000000a5   jeq mount 0049 (false 002a)
1691               002a: 15 1e 00 000000b4   jeq nfsservctl 0049 (false 002b)
1692               002b: 15 1d 00 0000009b   jeq pivot_root 0049 (false 002c)
1693               002c: 15 1c 00 000000ab   jeq setdomainname 0049 (false 002d)
1694               002d: 15 1b 00 000000aa   jeq sethostname 0049 (false 002e)
1695               002e: 15 1a 00 000000a6   jeq umount2 0049 (false 002f)
1696               002f: 15 19 00 00000099   jeq vhangup 0049 (false 0030)
1697               0030: 15 18 00 000000ee   jeq set_mempolicy 0049 (false 0031)
1698               0031: 15 17 00 00000100   jeq migrate_pages 0049 (false 0032)
1699               0032: 15 16 00 00000117   jeq move_pages 0049 (false 0033)
1700               0033: 15 15 00 000000ed   jeq mbind 0049 (false 0034)
1701               0034: 15 14 00 00000130    jeq  open_by_handle_at  0049  (false
1702              0035)
1703               0035:  15  13  00  0000012f   jeq name_to_handle_at 0049 (false
1704              0036)
1705               0036: 15 12 00 000000fb   jeq ioprio_set 0049 (false 0037)
1706               0037: 15 11 00 00000067   jeq syslog 0049 (false 0038)
1707               0038: 15 10 00 0000012c   jeq fanotify_init 0049 (false 0039)
1708               0039: 15 0f 00 00000138   jeq kcmp 0049 (false 003a)
1709               003a: 15 0e 00 000000f8   jeq add_key 0049 (false 003b)
1710               003b: 15 0d 00 000000f9   jeq request_key 0049 (false 003c)
1711               003c: 15 0c 00 000000fa   jeq keyctl 0049 (false 003d)
1712               003d: 15 0b 00 000000ce   jeq io_setup 0049 (false 003e)
1713               003e: 15 0a 00 000000cf   jeq io_destroy 0049 (false 003f)
1714               003f: 15 09 00 000000d0   jeq io_getevents 0049 (false 0040)
1715               0040: 15 08 00 000000d1   jeq io_submit 0049 (false 0041)
1716               0041: 15 07 00 000000d2   jeq io_cancel 0049 (false 0042)
1717               0042: 15 06 00  000000d8    jeq  remap_file_pages  0049  (false
1718              0043)
1719               0043: 15 05 00 00000116   jeq vmsplice 0049 (false 0044)
1720               0044: 15 04 00 00000087   jeq personality 0049 (false 0045)
1721               0045: 15 03 00 00000143   jeq userfaultfd 0049 (false 0046)
1722               0046: 15 02 00 00000065   jeq ptrace 0049 (false 0047)
1723               0047:  15  01  00  00000136    jeq process_vm_readv 0049 (false
1724              0048)
1725               0048: 06 00 00 7fff0000   ret ALLOW
1726               0049: 06 00 01 00000000   ret KILL
1727              $
1728
1729
1730       --seccomp-error-action= kill | ERRNO
1731              By default, if a  seccomp  filter  blocks  a  system  call,  the
1732              process gets EPERM as the error. With --seccomp-error-action=er‐
1733              ror, another error number can be returned, for example ENOSYS or
1734              EACCES. The process can also be killed (like in versions <0.9.63
1735              of Firejail) by using --seccomp-error-action=kill syntax, or the
1736              attempt  may  be  logged  with  --seccomp-error-action=log.  Not
1737              killing the process weakens Firejail  slightly  when  trying  to
1738              contain  intrusion, but it may also allow tighter filters if the
1739              only alternative is to allow a system call.
1740
1741
1742       --shell=none
1743              Run the program directly, without a user shell.
1744
1745              Example:
1746              $ firejail --shell=none script.sh
1747
1748       --shell=program
1749              Set default user shell. Use this shell to  run  the  application
1750              using  -c shell option.  For example "firejail --shell=/bin/dash
1751              firefox" will start Mozilla Firefox as "/bin/dash  -c  firefox".
1752              By default the user's preferred shell is used.
1753
1754              Example: $firejail --shell=/bin/dash script.sh
1755
1756       --shutdown=name|pid
1757              Shutdown the sandbox identified by name or PID.
1758
1759              Example:
1760              $ firejail --name=mygame --caps.drop=all warzone2100 &
1761              $ firejail --shutdown=mygame
1762
1763              Example:
1764              $ firejail --list
1765              3272:netblue::firejail --private firefox
1766              $ firejail --shutdown=3272
1767
1768       --timeout=hh:mm:ss
1769              Kill  the  sandbox automatically after the time has elapsed. The
1770              time is specified in hours/minutes/seconds format.
1771
1772              $ firejail --timeout=01:30:00 firefox
1773
1774       --tmpfs=dirname
1775              Mount a writable tmpfs filesystem on directory dirname. This op‐
1776              tion  is  available only when running the sandbox as root.  File
1777              globbing is supported, see FILE GLOBBING section  for  more  de‐
1778              tails.
1779
1780              Example:
1781              # firejail --tmpfs=/var
1782
1783       --top  Monitor the most CPU-intensive sandboxes, see MONITORING section
1784              for more details.
1785
1786              Example:
1787              $ firejail --top
1788
1789       --trace[=filename]
1790              Trace open, access and connect  system  calls.  If  filename  is
1791              specified,  log  trace output to filename, otherwise log to con‐
1792              sole.
1793
1794              Example:
1795              $ firejail --trace wget -q www.debian.org
1796              Reading profile /etc/firejail/wget.profile
1797              3:wget:fopen64 /etc/wgetrc:0x5c8e8ce6c0
1798              3:wget:fopen /etc/hosts:0x5c8e8cfb70
1799              3:wget:socket AF_INET SOCK_DGRAM IPPROTO_IP:3
1800              3:wget:connect 3 8.8.8.8 port 53:0
1801              3:wget:socket AF_INET SOCK_STREAM IPPROTO_IP:3
1802              3:wget:connect 3 130.89.148.14 port 80:0
1803              3:wget:fopen64 index.html:0x5c8e8d1a60
1804
1805              parent is shutting down, bye...
1806
1807       --tracelog
1808              This option enables auditing blacklisted files and  directories.
1809              A message is sent to syslog in case the file or the directory is
1810              accessed.
1811
1812              Example:
1813              $ firejail --tracelog firefox
1814
1815              Sample messages:
1816              $ sudo tail -f /var/log/syslog
1817              [...]
1818              Dec  3 11:43:25 debian firejail[70]: blacklist violation - sand‐
1819              box 26370, exe firefox, syscall open64, path /etc/shadow
1820              Dec  3 11:46:17 debian firejail[70]: blacklist violation - sand‐
1821              box 26370, exe firefox, syscall opendir, path /boot
1822              [...]
1823
1824       --tree Print a tree of all sandboxed processes, see MONITORING  section
1825              for more details.
1826
1827              Example:
1828              $ firejail --tree
1829              11903:netblue:firejail iceweasel
1830                11904:netblue:iceweasel
1831                  11957:netblue:/usr/lib/iceweasel/plugin-container
1832              11969:netblue:firejail --net=eth0 transmission-gtk
1833                11970:netblue:transmission-gtk
1834
1835
1836       --tunnel[=devname]
1837              Connect  the  sandbox to a network overlay/VPN tunnel created by
1838              firetunnel utility. This options tries first the client side  of
1839              the tunnel. If this fails, it tries the server side. If multiple
1840              tunnels are active,  please  specify  the  tunnel  device  using
1841              --tunnel=devname.
1842
1843              The  available  tunnel devices are listed in /etc/firetunnel di‐
1844              rectory, one file for each device.  The files are regular  fire‐
1845              jail profile files containing the network configuration, and are
1846              created and managed by firetunnel utility.  By  default  ftc  is
1847              the  client-side  device  and fts is the server-side device. For
1848              more information please see man 1 firetunnel.
1849
1850              Example:
1851              $ firejail --tunnel firefox
1852
1853       --version
1854              Print program version/compile time support and exit.
1855
1856              Example:
1857              $ firejail --version
1858              firejail version 0.9.27
1859
1860              Compile time support:
1861                  - AppArmor support is enabled
1862                  - AppImage support is enabled
1863                  - chroot support is enabled
1864                  - file and directory whitelisting support is enabled
1865                  - file transfer support is enabled
1866                  - firetunnel support is enabled
1867                  - networking support is enabled
1868                  - overlayfs support is enabled
1869                  - private-home support is enabled
1870                  - seccomp-bpf support is enabled
1871                  - user namespace support is enabled
1872                  - X11 sandboxing support is enabled
1873
1874       --veth-name=name
1875              Use this name for the interface  connected  to  the  bridge  for
1876              --net=bridge_interface commands, instead of the default one.
1877
1878              Example:
1879              $ firejail --net=br0 --veth-name=if0
1880
1881       --whitelist=dirname_or_filename
1882              Whitelist  directory or file. A temporary file system is mounted
1883              on the top directory, and the whitelisted files are mount-binded
1884              inside.  Modifications  to whitelisted files are persistent, ev‐
1885              erything else is discarded when the sandbox is closed.  The  top
1886              directory  could  be  user home, /dev, /etc, /media, /mnt, /opt,
1887              /run/user/$UID, /srv, /sys/module, /tmp, /usr/share and /var.
1888
1889              Symbolic link handling: with the exception of  user  home,  both
1890              the  link and the real file should be in the same top directory.
1891              For user home, both the link and the real file should  be  owned
1892              by the user.
1893
1894              File  globbing  is supported, see FILE GLOBBING section for more
1895              details.
1896
1897              Example:
1898              $ firejail --noprofile --whitelist=~/.mozilla
1899              $ firejail --whitelist=/tmp/.X11-unix --whitelist=/dev/null
1900              $ firejail "--whitelist=/home/username/My Virtual Machines"
1901              $ firejail --whitelist=~/work* --whitelist=/var/backups*
1902
1903
1904       --writable-etc
1905              Mount /etc directory read-write.
1906
1907              Example:
1908              $ sudo firejail --writable-etc
1909
1910
1911       --writable-run-user
1912              Disable the default blacklisting of  /run/user/$UID/systemd  and
1913              /run/user/$UID/gnupg.
1914
1915              Example:
1916              $ sudo firejail --writable-run-user
1917
1918
1919       --writable-var
1920              Mount /var directory read-write.
1921
1922              Example:
1923              $ sudo firejail --writable-var
1924
1925
1926       --writable-var-log
1927              Use  the  real  /var/log  directory,  not a clone. By default, a
1928              tmpfs is mounted on top of /var/log directory,  and  a  skeleton
1929              filesystem is created based on the original /var/log.
1930
1931              Example:
1932              $ sudo firejail --writable-var-log
1933
1934
1935       --x11  Sandbox  the  application using Xpra, Xephyr, Xvfb or Xorg secu‐
1936              rity extension.  The sandbox will prevent screenshot and keylog‐
1937              ger  applications  started  inside  the  sandbox  from accessing
1938              clients running outside the sandbox.   Firejail  will  try  Xpra
1939              first,  and  if Xpra is not installed on the system, it will try
1940              to find Xephyr.  If all fails, Firejail will not attempt to  use
1941              Xvfb or X11 security extension.
1942
1943              Xpra,  Xephyr  and  Xvfb modes require a network namespace to be
1944              instantiated in order to disable X11 abstract  Unix  socket.  If
1945              this  is  not possible, the user can disable the abstract socket
1946              by adding "-nolisten local"  on  Xorg  command  line  at  system
1947              level.
1948
1949              Example:
1950              $ firejail --x11 --net=eth0 firefox
1951
1952
1953       --x11=none
1954              Blacklist  /tmp/.X11-unix directory, ${HOME}/.Xauthority and the
1955              file specified in ${XAUTHORITY}  environment  variable.   Remove
1956              DISPLAY  and  XAUTHORITY environment variables.  Stop with error
1957              message if X11 abstract socket will be accessible in jail.
1958
1959
1960       --x11=xephyr
1961              Start Xephyr and attach the sandbox to this server.  Xephyr is a
1962              display  server implementing the X11 display server protocol.  A
1963              network namespace needs to be instantiated in order to deny  ac‐
1964              cess to X11 abstract Unix domain socket.
1965
1966              Xephyr runs in a window just like any other X11 application. The
1967              default window  size  is  800x600.   This  can  be  modified  in
1968              /etc/firejail/firejail.config file.
1969
1970              The  recommended way to use this feature is to run a window man‐
1971              ager inside the sandbox.  A security profile for OpenBox is pro‐
1972              vided.
1973
1974              Xephyr  is  developed by Xorg project. On Debian platforms it is
1975              installed with the command sudo apt-get install  xserver-xephyr.
1976              This feature is not available when running as root.
1977
1978              Example:
1979              $ firejail --x11=xephyr --net=eth0 openbox
1980
1981
1982       --x11=xorg
1983              Sandbox  the application using the untrusted mode implemented by
1984              X11 security extension.  The  extension  is  available  in  Xorg
1985              package  and  it is installed by default on most Linux distribu‐
1986              tions. It provides support for a simple  trusted/untrusted  con‐
1987              nection  model. Untrusted clients are restricted in certain ways
1988              to prevent them from reading window contents of  other  clients,
1989              stealing input events, etc.
1990
1991              The  untrusted  mode  has  several limitations. A lot of regular
1992              programs  assume they are a trusted X11 clients and  will  crash
1993              or  lock  up  when  run  in untrusted mode. Chromium browser and
1994              xterm are two examples.  Firefox and transmission-gtk seem to be
1995              working  fine.  A network namespace is not required for this op‐
1996              tion.
1997
1998              Example:
1999              $ firejail --x11=xorg firefox
2000
2001
2002       --x11=xpra
2003              Start Xpra (https://xpra.org) and attach  the  sandbox  to  this
2004              server.   Xpra  is a persistent remote display server and client
2005              for forwarding X11 applications and desktop screens.  A  network
2006              namespace  needs  to  be instantiated in order to deny access to
2007              X11 abstract Unix domain socket.
2008
2009              On Debian platforms Xpra is installed with the command sudo apt-
2010              get install xpra.  This feature is not available when running as
2011              root.
2012
2013              Example:
2014              $ firejail --x11=xpra --net=eth0 firefox
2015
2016
2017
2018       --x11=xvfb
2019              Start Xvfb X11 server and attach the  sandbox  to  this  server.
2020              Xvfb,  short  for  X virtual framebuffer, performs all graphical
2021              operations in memory without showing any screen output. Xvfb  is
2022              mainly  used  for remote access and software testing on headless
2023              servers.
2024
2025              On Debian platforms Xvfb is installed with the command sudo apt-
2026              get install xvfb.  This feature is not available when running as
2027              root.
2028
2029              Example: remote VNC access
2030
2031              On the server we start a sandbox using Xvfb and  openbox  window
2032              manager.  The default size of Xvfb screen is 800x600 - it can be
2033              changed  in  /etc/firejail/firejail.config  (xvfb-screen).  Some
2034              sort  of  networking (--net) is required in order to isolate the
2035              abstract sockets used by other X servers.
2036
2037              $ firejail --net=none --x11=xvfb openbox
2038
2039              *** Attaching to Xvfb display 792 ***
2040
2041              Reading profile /etc/firejail/openbox.profile
2042              Reading profile /etc/firejail/disable-common.inc
2043              Reading profile /etc/firejail/disable-common.local
2044              Parent pid 5400, child pid 5401
2045
2046              On the server we also start a VNC server and attach  it  to  the
2047              display handled by our Xvfb server (792).
2048
2049              $ x11vnc -display :792
2050
2051              On  the  client machine we start a VNC viewer and use it to con‐
2052              nect to our server:
2053
2054              $ vncviewer
2055
2056
2057       --xephyr-screen=WIDTHxHEIGHT
2058              Set screen size for --x11=xephyr. The setting will overwrite the
2059              default  set  in  /etc/firejail/firejail.config  for the current
2060              sandbox. Run xrandr to get a list of  supported  resolutions  on
2061              your computer.
2062
2063              Example:
2064              $ firejail --net=eth0 --x11=xephyr --xephyr-screen=640x480 fire‐
2065              fox
2066
2067

AUDIT

2069       Audit feature allows the user to point out gaps in  security  profiles.
2070       The  implementation  replaces  the  program to be sandboxed with a test
2071       program. By default, we use faudit program distributed with Firejail. A
2072       custom test program can also be supplied by the user. Examples:
2073
2074       Running the default audit program:
2075            $ firejail --audit transmission-gtk
2076
2077       Running a custom audit program:
2078            $ firejail --audit=~/sandbox-test transmission-gtk
2079
2080       In  the examples above, the sandbox configures transmission-gtk profile
2081       and starts the test program. The real program,  transmission-gtk,  will
2082       not be started.
2083
2084       You can also audit a specific profile without specifying a program.
2085            $ firejail --audit --profile=/etc/firejail/zoom.profile
2086
2087       Limitations: audit feature is not implemented for --x11 commands.
2088
2089

DESKTOP INTEGRATION

2091       A  symbolic link to /usr/bin/firejail under the name of a program, will
2092       start the program in Firejail sandbox.  The  symbolic  link  should  be
2093       placed  in  the  first $PATH position. On most systems, a good place is
2094       /usr/local/bin directory. Example:
2095
2096              Make a firefox symlink to /usr/bin/firejail:
2097
2098              $ sudo ln -s /usr/bin/firejail /usr/local/bin/firefox
2099
2100              Verify $PATH
2101
2102              $ which -a firefox
2103              /usr/local/bin/firefox
2104              /usr/bin/firefox
2105
2106              Starting firefox in this moment, automatically invokes “firejail
2107              firefox”.
2108
2109       This  works  for  clicking on desktop environment icons, menus etc. Use
2110       "firejail --tree" to verify the program is sandboxed.
2111
2112              $ firejail --tree
2113              1189:netblue:firejail firefox
2114                1190:netblue:firejail firefox
2115                  1220:netblue:/bin/sh -c "/usr/lib/firefox/firefox"
2116                    1221:netblue:/usr/lib/firefox/firefox
2117
2118       We provide a tool that  automates  all  this  integration,  please  see
2119       firecfg(1) for more details.
2120
2121

EXAMPLES

2123       firejail
2124              Sandbox a regular shell session.
2125
2126       firejail firefox
2127              Start Mozilla Firefox.
2128
2129       firejail --debug firefox
2130              Debug Firefox sandbox.
2131
2132       firejail --private firefox
2133              Start Firefox with a new, empty home directory.
2134
2135       firejail --net=none vlc
2136              Start VLC in an unconnected network namespace.
2137
2138       firejail --net=eth0 firefox
2139              Start  Firefox  in a new network namespace. An IP address is as‐
2140              signed automatically.
2141
2142       firejail --net=br0 --ip=10.10.20.5 --net=br1 --net=br2
2143              Start a shell session in a new network namespace and connect  it
2144              to  br0,  br1, and br2 host bridge devices. IP addresses are as‐
2145              signed automatically for the interfaces connected to br1 and b2
2146
2147       firejail --list
2148              List all sandboxed processes.
2149
2150

FILE GLOBBING

2152       Globbing is the operation that expands a wildcard pattern into the
2153              list of pathnames matching the pattern.  This pattern is matched
2154              at  firejail start, and is NOT UPDATED at runtime.  Files match‐
2155              ing a blacklist, but created after firejail start will be acces‐
2156              sible within the jail. Matching is defined by:
2157
2158              - '?' matches any character
2159              - '*' matches any string
2160              - '[' denotes a range of characters
2161
2162       The globbing feature is implemented using glibc glob command. For
2163              more information on the wildcard syntax see man 7 glob.
2164
2165
2166       The following command line options are supported: --blacklist,
2167              --private-bin, --noexec, --read-only, --read-write, --tmpfs, and
2168              --whitelist.
2169
2170
2171       Examples:
2172
2173              $ firejail --private-bin=sh,bash,python*
2174              $ firejail --blacklist=~/dir[1234]
2175              $ firejail --read-only=~/dir[1-4]
2176
2177

FILE TRANSFER

2179       These features allow the user to inspect the filesystem container of an
2180       existing  sandbox and transfer files between the container and the host
2181       filesystem.
2182
2183
2184       --cat=name|pid filename
2185              Write content of a container file to standard out. The container
2186              is specified by name or PID.  If standard out is a terminal, all
2187              ASCII control characters except new line and horizontal tab  are
2188              replaced.
2189
2190
2191       --get=name|pid filename
2192              Retrieve the container file and store it on the host in the cur‐
2193              rent working directory.  The container is specified by  name  or
2194              PID.
2195
2196
2197       --ls=name|pid dir_or_filename
2198              List container files. The container is specified by name or PID.
2199
2200
2201       --put=name|pid src-filename dest-filename
2202              Put  src-filename in sandbox container.  The container is speci‐
2203              fied by name or PID.
2204
2205
2206       Examples:
2207
2208              $ firejail --name=mybrowser --private firefox
2209
2210              $ firejail --ls=mybrowser ~/Downloads
2211              drwxr-xr-x netblue  netblue         4096 .
2212              drwxr-xr-x netblue  netblue         4096 ..
2213              -rw-r--r-- netblue  netblue         7847 x11-x305.png
2214              -rw-r--r-- netblue  netblue         6800 x11-x642.png
2215              -rw-r--r-- netblue  netblue        34139 xpra-clipboard.png
2216
2217              $ firejail --get=mybrowser ~/Downloads/xpra-clipboard.png
2218
2219              $ firejail --put=mybrowser xpra-clipboard.png  ~/Downloads/xpra-
2220              clipboard.png
2221
2222              $ firejail --cat=mybrowser ~/.bashrc
2223

MONITORING

2225       Option  --list  prints  a  list  of  all sandboxes. The format for each
2226       process entry is as follows:
2227
2228            PID:USER:Sandbox Name:Command
2229
2230       Option --tree prints the tree of processes running in the sandbox.  The
2231       format for each process entry is as follows:
2232
2233            PID:USER:Sandbox Name:Command
2234
2235       Option  --top  is  similar  to the UNIX top command, however it applies
2236       only to sandboxes.
2237
2238       Option --netstats prints network statistics for  active  sandboxes  in‐
2239       stalling new network namespaces.
2240
2241       Listed  below  are the available fields (columns) in alphabetical order
2242       for --top and --netstats options:
2243
2244
2245       Command
2246              Command used to start the sandbox.
2247
2248       CPU%   CPU usage, the sandbox share of the elapsed CPU time  since  the
2249              last screen update
2250
2251       PID    Unique process ID for the task controlling the sandbox.
2252
2253       Prcs   Number  of  processes running in sandbox, including the control‐
2254              ling process.
2255
2256       RES    Resident Memory Size (KiB), sandbox non-swapped physical memory.
2257              It  is  a sum of the RES values for all processes running in the
2258              sandbox.
2259
2260       RX(KB/s)
2261              Network receive speed.
2262
2263       Sandbox Name
2264              The name of the sandbox, if any.
2265
2266       SHR    Shared Memory Size (KiB), it reflects memory shared  with  other
2267              processes.  It is a sum of the SHR values for all processes run‐
2268              ning in the sandbox, including the controlling process.
2269
2270       TX(KB/s)
2271              Network transmit speed.
2272
2273       Uptime Sandbox running time in hours:minutes:seconds format.
2274
2275       USER   The owner of the sandbox.
2276
2277

RESTRICTED SHELL

2279       To configure a restricted shell, replace /bin/bash with  /usr/bin/fire‐
2280       jail in /etc/passwd file for each user that needs to be restricted. Al‐
2281       ternatively, you can specify /usr/bin/firejail  in adduser command:
2282
2283       adduser --shell /usr/bin/firejail username
2284
2285       Additional arguments passed to firejail executable upon login  are  de‐
2286       clared in /etc/firejail/login.users file.
2287
2288

SECURITY PROFILES

2290       Several command line options can be passed to the program using profile
2291       files. Firejail chooses the profile file as follows:
2292
2293       1. If a profile file is provided by the user  with  --profile=FILE  op‐
2294       tion,  the  profile  FILE  is loaded. If a profile name is given, it is
2295       searched for first in the ~/.config/firejail directory and if not found
2296       then  in   /etc/firejail  directory.  Profile  names do not include the
2297       .profile suffix. If there is a file with the same  name  as  the  given
2298       profile  name,  it will be used instead of doing the profile search. To
2299       force a profile search, prefix the profile name with a colon  (:),  eg.
2300       --profile=:PROFILE_NAME.  Example:
2301
2302              $ firejail --profile=/home/netblue/icecat.profile icecat
2303              Reading profile /home/netblue/icecat.profile
2304              [...]
2305
2306
2307              $ firejail --profile=icecat icecat-wrapper.sh
2308              Reading profile /etc/firejail/icecat.profile
2309              [...]
2310
2311       2.  If  a profile file with the same name as the application is present
2312       in ~/.config/firejail directory or in  /etc/firejail,  the  profile  is
2313       loaded.  ~/.config/firejail  takes precedence over /etc/firejail. Exam‐
2314       ple:
2315
2316              $ firejail icecat
2317              Command name #icecat#
2318              Found icecat profile in /home/netblue/.config/firejail directory
2319              Reading profile /home/netblue/.config/firejail/icecat.profile
2320              [...]
2321
2322       3. Use default.profile file if the sandbox  is  started  by  a  regular
2323       user,  or  server.profile file if the sandbox is started by root. Fire‐
2324       jail looks for these files in ~/.config/firejail directory, followed by
2325       /etc/firejail directory.  To disable default profile loading, use --no‐
2326       profile command option. Example:
2327
2328              $ firejail
2329              Reading profile /etc/firejail/default.profile
2330              Parent pid 8553, child pid 8554
2331              Child process initialized
2332              [...]
2333
2334              $ firejail --noprofile
2335              Parent pid 8553, child pid 8554
2336              Child process initialized
2337              [...]
2338
2339       See man 5 firejail-profile for profile file syntax information.
2340

TRAFFIC SHAPING

2342       Network bandwidth is an expensive resource shared among  all  sandboxes
2343       running  on a system.  Traffic shaping allows the user to increase net‐
2344       work performance by controlling the amount of data that flows into  and
2345       out of the sandboxes.
2346
2347       Firejail  implements  a simple rate-limiting shaper based on Linux com‐
2348       mand tc.  The shaper works at sandbox level, and can be used  only  for
2349       sandboxes configured with new network namespaces.
2350
2351       Set rate-limits:
2352
2353            $ firejail --bandwidth=name|pid set network download upload
2354
2355       Clear rate-limits:
2356
2357            $ firejail --bandwidth=name|pid clear network
2358
2359       Status:
2360
2361            $ firejail --bandwidth=name|pid status
2362
2363       where:
2364            name - sandbox name
2365            pid - sandbox pid
2366            network - network interface as used by --net option
2367            download - download speed in KB/s (kilobyte per second)
2368            upload - upload speed in KB/s (kilobyte per second)
2369
2370       Example:
2371            $ firejail --name=mybrowser --net=eth0 firefox &
2372            $ firejail --bandwidth=mybrowser set eth0 80 20
2373            $ firejail --bandwidth=mybrowser status
2374            $ firejail --bandwidth=mybrowser clear eth0
2375

LICENSE

2377       This program is free software; you can redistribute it and/or modify it
2378       under the terms of the GNU General Public License as published  by  the
2379       Free  Software Foundation; either version 2 of the License, or (at your
2380       option) any later version.
2381
2382       Homepage: https://firejail.wordpress.com
2383

SEE ALSO

2385       firemon(1), firecfg(1), firejail-profile(5),  firejail-login(5),  fire‐
2386       jail-users(5),            ⟨https://github.com/netblue30/firejail/wiki⟩,
2387https://github.com/netblue30/firejail
2388
2389
2390
23910.9.64.4                           Feb 2021                        FIREJAIL(1)
Impressum