Skip to content

Commit c96a56d

Browse files
committed
ensure /run/sshd exists and manage ssh.socket on noble
/run/sshd is on tmpfs and can disappear after cleanup, causing sshd to fail with "Missing privilege separation directory". Create it explicitly in the state rather than relying only on tmpfiles. On Noble, SSH uses socket activation (ssh.socket). Ensure the socket is enabled and running before the service, preventing the dependency failure loop.
1 parent ccb5303 commit c96a56d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

salt/ssh/init.sls

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
11
{% set host_keys = salt["pillar.get"]("ssh_host_keys") %}
22

3+
# Ensure /run/sshd exists (tmpfs, can disappear between boots/cleanups)
4+
/run/sshd:
5+
file.directory:
6+
- user: root
7+
- group: root
8+
- dir_mode: "0755"
9+
10+
{% if grains["oscodename"] in ["noble"] %}
11+
# Noble uses socket-activated SSH
12+
ssh.socket:
13+
service.running:
14+
- enable: True
15+
- require:
16+
- file: /run/sshd
17+
- file: /etc/ssh/sshd_config
18+
{% endif %}
319

420
ssh:
521
service.running:
622
- enable: True
723
- restart: True
24+
- require:
25+
- file: /run/sshd
26+
{% if grains["oscodename"] in ["noble"] %}
27+
- service: ssh.socket
28+
{% endif %}
829
- watch:
930
- file: /etc/ssh/sshd_config
1031
{% for fn in host_keys %}

0 commit comments

Comments
 (0)