-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
[BUG] SSH service is not restarted in ubuntu 24.04 #536
Comments
Thanks for creating the issue @GauthierPLM, I believe it's fixed now. |
I tested again today and while there was no warning about sshd service not being found, the service wasn't restarted and I had to restart it manually. |
So the fix didn't work? |
It does not indeed. |
Can you try this diff? diff --git a/scripts/sshdconfig b/scripts/sshdconfig
index 8a971b7..01a22bf 100644
--- a/scripts/sshdconfig
+++ b/scripts/sshdconfig
@@ -170,7 +170,7 @@ function f_sshdconfig {
chown root:root "$SSHDCONF"
chmod 0600 "$SSHDCONF"
- systemctl restart ssh.service
+ bash -it -c 'systemctl restart ssh.service'
if [[ $VERBOSE == "Y" ]]; then
systemctl status ssh.service --no-pager |
Tried today at 12h30 on an existing machine (not yet hardened), and the fix didn't solve the issue. The service still listen on port 22: # ss -tulpn | grep -e 'ssh\|12322'
tcp LISTEN 0 4096 *:22 *:* users:(("sshd",pid=65406,fd=3)) I had to restart the service myself. |
don't really have an idea why this is happening, will continue to test |
I don't know if it will help, but the machines are ARN cloud servers from Hetzner, running Ubuntu 24.04. This is my cloud-init.yaml file:
|
Describe the bug
During setup, the ssh service is not properly restarted at the end of the setup process.
If SSH port has been changed, we are locked outside the machine as ufw only allows the new port but sshd is still listening on the old port.
The service name is now
ssh
and no moresshd
, maybe this causes the issue?To Reproduce
any
asFW_ADMIN
value.Expected behavior
ssh.service
should be properly restarted.System (lsb_release -a):
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.1 LTS
Release: 24.04
Codename: noble
The text was updated successfully, but these errors were encountered: