[GH-ISSUE #6490] Reintroduce shell feature #3290

Open
opened 2026-05-05 09:53:36 -06:00 by gitea-mirror · 15 comments
Owner

Originally created by @ganeshjkale on GitHub (Sep 27, 2024).
Original GitHub issue: https://github.com/netblue30/firejail/issues/6490

#OS : Redhat 9.4
#Firejail : v0.9.72
#Command
firejail --shell=/bin/rbash --profile=/etc/firejail/abc.profile /usr/bin/gedit
firejail --shell=/bin/rbash /usr/bin/gedit
firejail --shell=/bin/rbash --noprofile /usr/bin/gedit

shell feature enables to provide more security , not able to find its alternative and documentation.
please help

Originally created by @ganeshjkale on GitHub (Sep 27, 2024). Original GitHub issue: https://github.com/netblue30/firejail/issues/6490 #OS : Redhat 9.4 #Firejail : v0.9.72 #Command firejail --shell=/bin/rbash --profile=/etc/firejail/abc.profile /usr/bin/gedit firejail --shell=/bin/rbash /usr/bin/gedit firejail --shell=/bin/rbash --noprofile /usr/bin/gedit shell feature enables to provide more security , not able to find its alternative and documentation. please help
gitea-mirror added the
enhancement
needinfo
labels 2026-05-05 09:53:36 -06:00
Author
Owner

@rusty-snake commented on GitHub (Sep 27, 2024):

What do you mean with shell feature?

Why does it provide more security?

<!-- gh-comment-id:2379121028 --> @rusty-snake commented on GitHub (Sep 27, 2024): What do you mean with shell feature? Why does it provide more security?
Author
Owner

@kmk3 commented on GitHub (Sep 27, 2024):

Basic information is missing; please follow the feature request template:

<!-- gh-comment-id:2379286279 --> @kmk3 commented on GitHub (Sep 27, 2024): Basic information is missing; please follow the feature request template: * <https://github.com/netblue30/firejail/issues/new?template=feature_request.md>
Author
Owner

@ganeshjkale commented on GitHub (Sep 27, 2024):

For eg. combine firejail with rbash or custom shell

<!-- gh-comment-id:2379306362 --> @ganeshjkale commented on GitHub (Sep 27, 2024): For eg. combine firejail with rbash or custom shell
Author
Owner

@rusty-snake commented on GitHub (Sep 27, 2024):

firejail rbash?

You need to explain in more detail.

<!-- gh-comment-id:2379317949 --> @rusty-snake commented on GitHub (Sep 27, 2024): `firejail rbash`? You need to explain in more detail.
Author
Owner

@ganeshjkale commented on GitHub (Sep 27, 2024):

Firejail v0.9.70 below command.
firejail --shell=/bin/rbash application

<!-- gh-comment-id:2379326983 --> @ganeshjkale commented on GitHub (Sep 27, 2024): Firejail v0.9.70 below command. firejail --shell=/bin/rbash application
Author
Owner

@rusty-snake commented on GitHub (Sep 27, 2024):

And why is a --shell required? Why not simply firejail /bin/rbash application?

<!-- gh-comment-id:2379331129 --> @rusty-snake commented on GitHub (Sep 27, 2024): And why is a `--shell` required? Why not simply `firejail /bin/rbash application`?
Author
Owner

@ganeshjkale commented on GitHub (Sep 27, 2024):

#not working getting cannot execute binary gedit.
firejail /bin/rbash gedit

#working
firejail gedit

<!-- gh-comment-id:2379363831 --> @ganeshjkale commented on GitHub (Sep 27, 2024): #not working getting cannot execute binary gedit. firejail /bin/rbash gedit #working firejail gedit
Author
Owner

@rusty-snake commented on GitHub (Sep 27, 2024):

Maybe you should outline why you even need/want a rbash.

not working getting cannot execute binary gedit

firejail /bin/bash -r -c gedit

<!-- gh-comment-id:2379420999 --> @rusty-snake commented on GitHub (Sep 27, 2024): Maybe you should outline why you even need/want a rbash. > not working getting cannot execute binary gedit `firejail /bin/bash -r -c gedit`
Author
Owner

@luitzifa commented on GitHub (Nov 19, 2024):

IMHO this is a regression introduced in 0.9.72. The --shell feature was removed here: https://github.com/netblue30/firejail/issues/5190
The feature is needed to use firejail directly as login shell.
This issue is somewhat related to https://github.com/netblue30/firejail/issues/6206

<!-- gh-comment-id:2485856415 --> @luitzifa commented on GitHub (Nov 19, 2024): IMHO this is a regression introduced in 0.9.72. The --shell feature was removed here: https://github.com/netblue30/firejail/issues/5190 The feature is needed to use firejail directly as login shell. This issue is somewhat related to https://github.com/netblue30/firejail/issues/6206
Author
Owner

@rusty-snake commented on GitHub (Nov 19, 2024):

A small wrapper (e.g. firejail-sh) would fit this better IMHO.

<!-- gh-comment-id:2485893626 --> @rusty-snake commented on GitHub (Nov 19, 2024): A small wrapper (e.g. `firejail-sh`) would fit this better IMHO.
Author
Owner

@luitzifa commented on GitHub (Nov 19, 2024):

I cannot get a wrapper like

root@notebook:~# cat /usr/local/bin/firejail-login.sh
#!/bin/sh
/usr/bin/firejail --quiet --profile=/etc/firejail/myprofile.profile /bin/bash

to work with something like this:
ssh -o IdentityAgent=none testuser2@127.0.0.1 'ls /dev'

I can login and execute the command, but i need to be able to execute the command directly over ssh in firejail.

<!-- gh-comment-id:2486045843 --> @luitzifa commented on GitHub (Nov 19, 2024): I cannot get a wrapper like ``` root@notebook:~# cat /usr/local/bin/firejail-login.sh #!/bin/sh /usr/bin/firejail --quiet --profile=/etc/firejail/myprofile.profile /bin/bash ``` to work with something like this: `ssh -o IdentityAgent=none testuser2@127.0.0.1 'ls /dev'` I can login and execute the command, but i need to be able to execute the command directly over ssh in firejail.
Author
Owner

@rusty-snake commented on GitHub (Nov 19, 2024):

Passing arguments could help. Untested:

#!/bin/sh
exec /usr/bin/firejail --quiet --profile=/etc/firejail/myprofile.profile /bin/bash -- "$@"
<!-- gh-comment-id:2486175444 --> @rusty-snake commented on GitHub (Nov 19, 2024): Passing arguments could help. Untested: ```bash #!/bin/sh exec /usr/bin/firejail --quiet --profile=/etc/firejail/myprofile.profile /bin/bash -- "$@" ```
Author
Owner

@luitzifa commented on GitHub (Nov 21, 2024):

I tested your wrapper. Did not work :( , also the login is broken too.

❯ ssh -o IdentityAgent=none testuser@127.0.0.1
testuser@127.0.0.1's password:
Welcome to Ubuntu 24.04.1 LTS (GNU/Linux 6.8.0-49-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/pro

Last login: Thu Nov 21 10:24:21 2024 from 127.0.0.1
/bin/bash: -c: No such file or directory
Connection to 127.0.0.1 closed.
❯ ssh -o IdentityAgent=none testuser@127.0.0.1 'ls /dev'
testuser@127.0.0.1's password:
/bin/bash: -c: No such file or directory
<!-- gh-comment-id:2490515388 --> @luitzifa commented on GitHub (Nov 21, 2024): I tested your wrapper. Did not work :( , also the login is broken too. ``` ❯ ssh -o IdentityAgent=none testuser@127.0.0.1 testuser@127.0.0.1's password: Welcome to Ubuntu 24.04.1 LTS (GNU/Linux 6.8.0-49-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/pro Last login: Thu Nov 21 10:24:21 2024 from 127.0.0.1 /bin/bash: -c: No such file or directory Connection to 127.0.0.1 closed. ❯ ssh -o IdentityAgent=none testuser@127.0.0.1 'ls /dev' testuser@127.0.0.1's password: /bin/bash: -c: No such file or directory ```
Author
Owner

@rusty-snake commented on GitHub (Nov 21, 2024):

If passing non-file-arguments to bash is required, remove the --.

<!-- gh-comment-id:2490546708 --> @rusty-snake commented on GitHub (Nov 21, 2024): If passing non-file-arguments to bash is required, remove the `--`.
Author
Owner

@luitzifa commented on GitHub (Nov 21, 2024):

That did the trick. I will test it further:

❯ cat /usr/local/bin/firejail-login.sh
#!/bin/sh
/usr/bin/firejail --quiet --profile=/etc/firejail/myloginshell.profile /bin/bash "$@"
❯ grep testuser /etc/passwd
testuser:x:994:981::/home/testuser:/usr/local/bin/firejail-login.sh
testuser2:x:993:980::/home/testuser2:/usr/bin/firejail
❯ ssh -o IdentityAgent=none testuser@127.0.0.1 'ls -la /dev | grep random'
testuser@127.0.0.1's password:
crw-rw-rw-   1 nobody nogroup   1, 8 Nov 21 10:35 random
crw-rw-rw-   1 nobody nogroup   1, 9 Nov 21 10:35 urandom

Thanks

<!-- gh-comment-id:2490566919 --> @luitzifa commented on GitHub (Nov 21, 2024): That did the trick. I will test it further: ``` ❯ cat /usr/local/bin/firejail-login.sh #!/bin/sh /usr/bin/firejail --quiet --profile=/etc/firejail/myloginshell.profile /bin/bash "$@" ❯ grep testuser /etc/passwd testuser:x:994:981::/home/testuser:/usr/local/bin/firejail-login.sh testuser2:x:993:980::/home/testuser2:/usr/bin/firejail ❯ ssh -o IdentityAgent=none testuser@127.0.0.1 'ls -la /dev | grep random' testuser@127.0.0.1's password: crw-rw-rw- 1 nobody nogroup 1, 8 Nov 21 10:35 random crw-rw-rw- 1 nobody nogroup 1, 9 Nov 21 10:35 urandom ``` Thanks
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

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