Changing Port in sshd_config requires calling systemctl daemon-reload
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openssh (Ubuntu) |
Fix Released
|
Medium
|
Nick Rosbrook | ||
Noble |
Fix Committed
|
Medium
|
Nick Rosbrook |
Bug Description
[Impact]
There is currently no comment in the default /etc/ssh/
Users may change e.g. Port in /etc/ssh/
[Test Plan]
1. The proposed fix here is to improve the documentation by adding a comment above the default Port setting in /etc/ssh/
2. Because the patch changes the default sshd_config, and debian/
[Where problems could occur]
There is low technical risk, but we should be sure that the documentation is clear and improves the experience of users. It could be harmful if the documentation accidentally makes things worse, or is just confusing.
Also, a packaging quirk of openssh-server is that checksums of the patched sshd_config (along with certain settings tweaked) need to be recorded in debian/
[Original Description]
Changing the Port directive in sshd_config and restarting ssh.service is without effect, sshd keeps listening to port 22.
Also mentioned in https:/
Steps to reproduce:
1. Install Ubuntu 24.04 LTS
2. Change Port directive in /etc/ssh/
3. Restart ssh.service
4. Observe sshd still listening to port 22
Expected behaviour: sshd changes port to 2233
Actual behaviour: sshd keeps listening to port 22
tags: | added: rls-nn-incoming rls-oo-incoming |
Changed in openssh (Ubuntu): | |
status: | New → Triaged |
tags: |
added: foundations-todo removed: rls-nn-incoming rls-oo-incoming |
description: | updated |
Changed in openssh (Ubuntu): | |
status: | Triaged → Fix Committed |
description: | updated |
summary: |
- Changing Port in sshd_config and restarting ssh.service without effect + Changing Port in sshd_config requires calling systemctl daemon-reload |
Changed in openssh (Ubuntu Noble): | |
status: | Triaged → In Progress |
tags: | added: noble |
Changed in openssh (Ubuntu Noble): | |
status: | In Progress → Triaged |
Changed in openssh (Ubuntu Noble): | |
status: | Triaged → In Progress |
With 24.04 LTS, ssh is socket activated by default. The configuration for the socket is generated by reading the regular /etc/ssh/ sshd_config (or /etc/ssh/ sshd_config. d/ snippets), but the configuration needs to be reloaded. So, the steps for configuring a new port are:
# Add new port to /etc/ssh/ sshd_config. d/port. conf
systemctl daemon-reload
systemctl restart ssh.socket
The key point being that a systemctl daemon-reload is needed.