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

Fix sshd handlers for Debian 12. #135

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

klemens-st
Copy link
Contributor

Debian 12, Ubuntu 22 and above need to re-run systemd generators to pull the updated sshd port config.

Just changing sshd_config has no effect, sshd still listens on default port 22.

In this PR I add an additional handler for Debian that simply runs systemctl daemon-reload. This forces systemd to rerun its generators.

https://discourse.ubuntu.com/t/sshd-now-uses-socket-based-activation-ubuntu-22-10-and-later/30189/14

@@ -1,4 +1,6 @@
---
- name: systemd reload
ansible.builtin.command: systemctl daemon-reload
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use the Ansible module instead?

https://docs.ansible.com/ansible/latest/collections/ansible/builtin/systemd_service_module.html#ansible-collections-ansible-builtin-systemd-service-module

Also for this file, please use one line of spacing between the tasks

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please name the handler "reload systemd"

Debian 12, Ubuntu 22 and above need to re-run systemd generators
to pull the updated sshd port config.

https://discourse.ubuntu.com/t/sshd-now-uses-socket-based-activation-ubuntu-22-10-and-later/30189/14
@klemens-st klemens-st force-pushed the sshd-debian-handlers branch from 5b56f01 to e7b5b93 Compare March 3, 2025 14:36
@klemens-st klemens-st requested a review from geerlingguy March 3, 2025 14:38
@geerlingguy geerlingguy merged commit 8376f1f into geerlingguy:master Mar 3, 2025
4 checks passed
@klemens-st klemens-st deleted the sshd-debian-handlers branch March 3, 2025 15:54
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