Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow logging in to rescue/emergency shell as root #526

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

DemiMarie
Copy link
Contributor

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.

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.

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.57%. Comparing base (e734630) to head (958f43d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #526      +/-   ##
==========================================
+ Coverage   70.14%   70.57%   +0.42%     
==========================================
  Files           3        3              
  Lines         469      469              
==========================================
+ Hits          329      331       +2     
+ Misses        140      138       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@marmarek
Copy link
Member

marmarek commented Nov 4, 2024

Should those drop-ins be included in initramfs (when generated in VM) too? Or maybe they already are there?

@DemiMarie
Copy link
Contributor Author

Should those drop-ins be included in initramfs (when generated in VM) too? Or maybe they already are there?

Yes, they should. Dracut module?

@DemiMarie DemiMarie force-pushed the sulogin-force branch 2 times, most recently from 757ef06 to 9e612aa Compare November 4, 2024 21:13
@marmarek
Copy link
Member

marmarek commented Nov 6, 2024

19:36:45 [qb.build_rpm.core-agent-linux.vm-fc40.build] DEBUG: RPM build errors:
19:36:45 [qb.build_rpm.core-agent-linux.vm-fc40.build] DEBUG: error: File not found: /builddir/build/BUILDROOT/qubes-core-agent-4.3.11-1.1.fc40.x86_64/usr/lib/dracut/modules.d/99qubes/module-setup.sh

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.

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.
This was recommended on Fedora's Matrix channel.
@DemiMarie
Copy link
Contributor Author

Should this be conditional on the VM not being sys-usb? sys-usb might get an untrusted USB serial port plugged into it.

@marmarek
Copy link
Member

marmarek commented Nov 6, 2024

Should this be conditional on the VM not being sys-usb? sys-usb might get an untrusted USB serial port plugged into it.

Similar issue may apply to other VM too. Can you make it specifically for hvc0 console only instead?

@marmarek
Copy link
Member

marmarek commented Nov 6, 2024

Should this be conditional on the VM not being sys-usb? sys-usb might get an untrusted USB serial port plugged into it.

But actually does other consoles matter here? Isn't rescue/emergency started only on the primary console (as configured with console= kernel param)?

@DemiMarie
Copy link
Contributor Author

Should this be conditional on the VM not being sys-usb? sys-usb might get an untrusted USB serial port plugged into it.

But actually does other consoles matter here? Isn't rescue/emergency started only on the primary console (as configured with console= kernel param)?

It should be indeed. I can check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants