mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3534] How to use "passwd" in a firejail login shell? #2221
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#2221
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 @jsquyres on GitHub (Jul 21, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3534
Greetings, and thanks for firejail!
Question
I'm trying to use Firejail as a restricted login shell, and in general, it works pretty great. On an Ubuntu 18.04 system with the distro-provided firejail v0.9.52, per firejail(1), I have
/usr/bin/firejailas the shell for my user, and per firejail-login(5), I have/etc/firejail/login.usersset with:Outside the firejail, I see that
/usr/bin/passwdis setuid and owned byroot:root:However, I see that in the firejail, while the setuid bit
/bin/passwdis visible, it is owned bynobody:nogroup:This seems to prevent
passwdfrom running properly, because/etc/shadowis owned by root and 0400, and therefore not readable by thenobodyuser.Has anyone tried to use firejail as a login shell and also successfully allowed the user to use the
passwdcommand?Does
--private-binautomatically copy files over asnobody:nogroup?Reproduce
Steps to reproduce the behavior:
/etc/firejail/login.usersas above/usr/bin/firejailas their shellpasswdprogrampasswdpasswdfail because it can't read/etc/shadow, and therefore can't validate your passwordEnvironment
Additional context
NA
Checklist
find / -name 'firejail' 2>/dev/null/fd firejailto locate profiles ie in/usr/local/etc/firejail/PROGRAM.profile)debug output
Can't really supply the output of
firejail --debug ...because this is a login shell.@FOSSONLY commented on GitHub (Jul 22, 2020):
Using a restricted shell based on firejail already implies that the respective user should be denied many critical resources. You, however, use the restricted shell, and you break it step by step by releasing critical resources, or should be released, which goes against the basic purpose behind it. By the way, a restricted shell based on bash (rbash) is completely insecure and still unsuitable to provide more security. If you already secure the login shell with firejail, then administrative tasks should no longer be done by the same user. Therefore the recommendation with Alt+Tab+F{1-6} (may vary depending on desktop and Xorg/Wayland) simply change the TTY to open a new session via a direct login as root. Then you can perform your administrative tasks, log out again, and change the TTY again to enter the regular graphical session. This is less comfortable, but also hardly avoidable for more security. I would at least suggest you to practice it better that way.
@rusty-snake commented on GitHub (Jul 22, 2020):
private-binis mounted withnosuid, see #2969.@SkewedZeppelin commented on GitHub (Jul 22, 2020):
passwdis blacklisted in disable-common.inc which is included in the default profile.If you remove that along with other necessary files it should work.
--
Personally if your goal is providing untrusted users access to a system, especially if it is remotely accessible, I would use something "stronger".
ie. full user confinement via selinux
If however all you need is remote file access for users, consider sshd chroot+internal-sftp and keys instead of passwords.
Either way I recommend a newer kernel and firejail.
Of extra note: scp is deprecated
@jsquyres commented on GitHub (Jul 22, 2020):
I translate the above responses to: "You can probably make
passwdwork in a firejail, but you probably shouldn't."Got it. Thanks!