-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow logging in to rescue/emergency shell as root
In Qubes OS guests, the console is _always_ the Xen console. There are _never_ untrusted entities with access to this under _any_ circumstances. The only supported way to get access to this from a VM is the admin.vm.Console service, which is (by design) equivalent to root access in the destination VM. Other consoles, such as a USB serial console, are not supported as domU consoles under Qubes OS. Therefore, set SYSTEMD_SULOGIN_FORCE=1 to tell systemd-sulogin-shell to pass --force to sulogin(8). Since the root account is locked in Qubes VMs, this causes sulogin(8) to allow login as root without a password. Use TTYPath= to enforce that the console is, in fact, the Xen console and not some other console, in case the assumption in the previous paragraph turns out false for some reason. This will break if the Xen drivers are not included in the guest kernel config, but an HVM guest with Qubes tools but no Xen drivers is not a supported configuration.
- Loading branch information
Showing
8 changed files
with
60 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ SYSTEM_DROPINS += systemd-random-seed.service | |
SYSTEM_DROPINS += tor.service [email protected] | ||
SYSTEM_DROPINS += systemd-timesyncd.service | ||
SYSTEM_DROPINS += systemd-logind.service | ||
SYSTEM_DROPINS += sysinit.target | ||
SYSTEM_DROPINS += sysinit.target emergency.service rescue.service | ||
ifeq ($(ENABLE_SELINUX),1) | ||
SYSTEM_DROPINS += selinux-autorelabel.target selinux-autorelabel.service | ||
endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
LIBDIR ?= /usr/lib | ||
SYSCONFDIR ?= /etc | ||
GRUBCONFDIR ?= $(SYSCONFDIR)/default | ||
DRACUTCONFDIR ?= $(LIBDIR)/dracut/dracut.conf.d | ||
GRUBCFGNAME ?= grub.qubes | ||
DRACUTDIR ?= $(LIBDIR)/dracut | ||
DRACUTCONFDIR ?= $(DRACUTDIR)/dracut.conf.d | ||
DRACUTMODDIR ?= $(DRACUTDIR)/modules.d | ||
|
||
.PHONY: install | ||
|
||
install: | ||
install -D -m 0644 grub.qubes $(DESTDIR)$(GRUBCONFDIR)/$(GRUBCFGNAME) | ||
install -D -m 0644 dracut-qubes.conf $(DESTDIR)$(DRACUTCONFDIR)/30-qubes.conf | ||
install -D -m 0755 module-setup.sh $(DESTDIR)$(DRACUTMODDIR)/99qubes/module-setup.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
depends () { | ||
} | ||
|
||
install () { | ||
if [ -h /lib ]; then | ||
inst_multiple /usr/lib/systemd/system/rescue.service.d/30_qubes.conf /usr/lib/systemd/system/emergency.service.d/30_qubes.conf | ||
else | ||
inst_multiple /lib/systemd/system/rescue.service.d/30_qubes.conf /lib/systemd/system/emergency.service.d/30_qubes.conf | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[Service] | ||
# Ensure that the console is the secure Xen console, | ||
# not e.g. a serial console that is exposed to the outside world. | ||
TTYPath=/dev/hvc0 | ||
Environment=SYSTEMD_SULOGIN_FORCE=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[Service] | ||
# Ensure that the console is the secure Xen console, | ||
# not e.g. a serial console that is exposed to the outside world. | ||
TTYPath=/dev/hvc0 | ||
Environment=SYSTEMD_SULOGIN_FORCE=1 |