Skip to content

Commit eec87be

Browse files
committed
ssh: add sshd-keygen service for firstboot
Need to generate the host keys on first boot, otherwise ssh will fail
1 parent 05b73be commit eec87be

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-License-Identifier: LGPL-2.1-or-later
2+
3+
[Unit]
4+
ConditionFirstBoot=yes
5+
ConditionPathIsReadWrite=/etc/ssh
6+
ConditionPathIsSymbolicLink=!/etc/ssh
7+
Before=ssh.service sshd.service [email protected]
8+
9+
[Service]
10+
Type=oneshot
11+
RemainAfterExit=yes
12+
ExecStart=ssh-keygen -A
13+
14+
[Install]
15+
WantedBy=ssh.service sshd.service [email protected] ssh.socket sshd.socket

mkosi.extra/usr/lib/systemd/system-preset/10-particleos.preset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ disable sshd.service
3232
disable ssh.service
3333
enable sshd.socket
3434
enable ssh.socket
35+
enable sshd-keygen.service

0 commit comments

Comments
 (0)