mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #6206] Shell not starting on login #3220
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#3220
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @intereglementet on GitHub (Feb 12, 2024).
Original GitHub issue: https://github.com/netblue30/firejail/issues/6206
Description
Trying to use firejail to execute a login shell (for user "service").
Grateful for input on this.
Steps to Reproduce
Firejail is set as shell.
And a shell profile that is included from login.users exists:
If no shell is provided no command is found:
Fair enough, so provide a shell:
Expected behavior
Bash as login shell
Actual behavior
Firejail is unable to find a working shell path
Behavior without a profile
Environment
/usr/local/bin/firejail --version
firejail version 0.9.73
uname -a
Linux ubuntu 5.15.0-91-generic #101~20.04.1-Ubuntu SMP Thu Nov 16 14:22:28 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
git rev-parse HEAD
bb45aa505dChecklist
/usr/bin/vlc) "fixes" it).https://github.com/netblue30/firejail/issues/1139)browser-allow-drm yes/browser-disable-u2f noinfirejail.configto allow DRM/U2F in browsers.--profile=PROFILENAMEto set the right profile. (Only relevant for AppImages)Log
@ghost commented on GitHub (Feb 12, 2024):
Longshot. There might be some confusion about correct syntax in login.users.
5d3b61de89/etc/login.users (L6)Yet, there's NO space between the user name and the program arguments:
5d3b61de89/etc/login.users (L10)5d3b61de89/etc/login.users (L14)Have you tried dropping that space yet? So:
@intereglementet commented on GitHub (Feb 12, 2024):
Well spotted. I tried a few different login.users variants without that space; unfortunately that was not it, that made no difference. I did however notice that additional arguments change the error message in a peculiar way.
Error: no suitable HOME=/home/service executable found
@ghost commented on GitHub (Feb 12, 2024):
Ah well, the 'space' thing would have been too easy I guess :-)
Other idea: the
allusersoption. But to avoid stabbing in the dark indefinately, you could try with our weakest (most permissive) profile and determine of you can get that to work:@intereglementet commented on GitHub (Feb 12, 2024):
Well, at this point stabbing is fine by me =)
...both gets:
Error: no suitable PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin executable found
@ghost commented on GitHub (Feb 15, 2024):
Found some time to come back to this. I can confirm that - at the very least - the
restricted shellfeature isn't working as described in the documentation. Perhaps I'm missing something vital though, I never tried using it before (simply because I only have single-user laptops).Below are some observations, for a newly created user
guest.What isn't working:
What seems to work:
I used
_seems_to work above because the configured options from/etc/firejail/login.usersare NOT respected:cat, yet I can use that regardless (just like I could any other command from inside the sandbox BTW)Side-note:
Login from TTY isn't possible at all: Login incorrect
Marking this as a bug.
@kmk3 commented on GitHub (Feb 15, 2024):
I didn't look into this too closely, but could it be related to
--shellbeingremoved in 0.9.72 (#5190 / #5196)?
0.9.73 also had some related changes which might affect this (for example, see
#5605).
Does it work in 0.9.70 or 0.9.72?
@intereglementet commented on GitHub (Feb 16, 2024):
A workaround seems to be putting the firejail command in a login shell script, like:
# cat login.sh
# chsh -s /path/login.sh service
@ghost commented on GitHub (Feb 16, 2024):
@intereglementet
Thanks for the workaround. Can your user
servicelogin from TTY with that? Or did you need something else in yourservice_user.profile?@intereglementet commented on GitHub (Feb 16, 2024):
This is an embedded system, so at this point I have only been able to test su -l and ssh. Nothing special was needed in the profile for that. Will get back to you if I get a chance to test tty.
@ghost commented on GitHub (Feb 16, 2024):
@intereglementet
No problem. Nice to see firejail being used on embedded systems. Thanks again for reporting this. Now we're aware of the issue we can work towards a fix that actually respects what is in login.users.
Cheers