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

sshd not starting after recent patch #2661

Open
ellisonpatterson opened this issue Jul 1, 2024 · 10 comments
Open

sshd not starting after recent patch #2661

ellisonpatterson opened this issue Jul 1, 2024 · 10 comments
Labels
bug Our bugs

Comments

@ellisonpatterson
Copy link

ellisonpatterson commented Jul 1, 2024

Describe the bug

Jul 01 06:56:14 op3 (sshd)[1612]: sshd.service: Referenced but unset environment variable evaluates to an empty string: CRYPTO_POLICY, OPTIONS, SSHD_OPTS
Jul 01 06:56:14 op3 sshd[1612]: /usr/lib64/misc/sshd-session does not exist or is not executable
Jul 01 06:56:14 op3 systemd[1]: sshd.service: Main process exited, code=exited, status=255/EXCEPTION
Jul 01 06:56:14 op3 systemd[1]: sshd.service: Failed with result 'exit-code'.
Jul 01 06:56:14 op3 systemd[1]: Failed to start OpenSSH server daemon.
Jul 01 06:56:33 op3 systemd[1]: Stopped OpenSSH server daemon.
Jul 01 06:56:39 op3 systemd[1]: Starting OpenSSH server daemon...
Jul 01 06:56:39 op3 systemd[1]: Started OpenSSH server daemon.

Dracut shell with debug enabled

Jul 01 07:42:46 op3 systemd[1]: sshd.service: Service restart interval 42s expired, scheduling restart.
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Trying to enqueue job sshd.service/start/restart-dependencies
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Installed new job sshd.service/start as 324
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Enqueued job sshd.service/start as 324
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Scheduled restart job, restart counter is at 4.
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Changed auto-restart -> auto-restart-queued
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Will spawn child (service_enter_start): /usr/sbin/sshd
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Passing 0 fds to service
Jul 01 07:42:46 op3 systemd[1]: sshd.service: About to execute: /usr/sbin/sshd -D "\$SSHD_OPTS" "\$OPTIONS" "\$CRYPTO_POLICY"
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Forked /usr/sbin/sshd as 1639
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Changed auto-restart-queued -> start
Jul 01 07:42:46 op3 systemd[1]: Starting OpenSSH server daemon...
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Child 1639 belongs to sshd.service.
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Main process exited, code=exited, status=255/EXCEPTION
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Failed with result 'exit-code'.
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Service will restart (restart setting)
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Changed start -> failed-before-auto-restart
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Job 324 sshd.service/start finished, result=failed
Jul 01 07:42:46 op3 systemd[1]: Failed to start OpenSSH server daemon.
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Unit entered failed state.
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Consumed 4ms CPU time.
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Next restart interval calculated as: 42s
Jul 01 07:42:46 op3 systemd[1]: sshd.service: Changed failed-before-auto-restart -> auto-restart

Distribution used
Gentoo
Kernel 6.9.7

Dracut version
sys-kernel/dracut-102

openssh-server version
net-misc/openssh-9.8_p1

Init system
SystemD

To Reproduce
Build initramfs with recent openssh-server patch.

Additional context
Add any other context you like about the problem here.

@ellisonpatterson ellisonpatterson added the bug Our bugs label Jul 1, 2024
@ellisonpatterson
Copy link
Author

Just confirmed in dracut shell that /usr/lib64/misc doesn't even exist.

@MartinX3
Copy link

MartinX3 commented Jul 1, 2024

I am not sure if it is connected to dracut.
I just updated it on my server without a restart.
I can't connect to my arch linux server again.

Here is an issue ticket about it
https://gitlab.archlinux.org/archlinux/packaging/packages/openssh/-/issues/5

It seems that at least if you didn't restart your server a restart of the sshd service in the same session you did the update will fix the access for your server access.
Of course I am too scared now to restart the server since I don't know if this will break the access forever.
(So better doing a downgrade).

@ghen2
Copy link

ghen2 commented Jul 1, 2024

Jul 01 06:56:14 op3 sshd[1612]: /usr/lib64/misc/sshd-session does not exist or is not executable

Your environment is missing the new sshd-session binary.

From https://www.openssh.com/releasenotes.html#9.8p1:

 * sshd(8): the server has been split into a listener binary, sshd(8),
   and a per-session binary "sshd-session". This allows for a much
   smaller listener binary, as it no longer needs to support the SSH
   protocol. As part of this work, support for disabling privilege
   separation (which previously required code changes to disable) and
   disabling re-execution of sshd(8) has been removed. Further
   separation of sshd-session into additional, minimal binaries is
   planned for the future.

@ellisonpatterson
Copy link
Author

ellisonpatterson commented Jul 1, 2024

Could we just include that file for now?
install_optional_items+=" /usr/lib64/misc/sshd-session "

@ellisonpatterson
Copy link
Author

ellisonpatterson commented Jul 1, 2024

That resolves the issue for me, so it is related to dracut-sshd.

@MartinX3
Copy link

MartinX3 commented Jul 1, 2024

@ellisonpatterson please reopen the issue.
It needs to be fixed in dracut since ssh support is a buildin feature.

@ellisonpatterson
Copy link
Author

@ellisonpatterson please reopen the issue. It needs to be fixed in dracut since ssh support is a buildin feature.

I apologize, it is re-open now.

@ellisonpatterson
Copy link
Author

@ellisonpatterson please reopen the issue. It needs to be fixed in dracut since ssh support is a buildin feature.

Wait, the only module using OpenSSH is 95ssh-client, I don't believe the client needs sshd-session?

@ghen2
Copy link

ghen2 commented Jul 1, 2024

Correct, it's a server binary.

@ellisonpatterson
Copy link
Author

Correct, it's a server binary.

Well then for the dracut-sshd module I just made a PR incase anyone else is using it.

gsauthof/dracut-sshd#79

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

No branches or pull requests

3 participants