| 1 | [Unit] |
| 2 | Description=Generate sshd host keys on first boot |
| 3 | ConditionFirstBoot=yes |
| 4 | ConditionPathIsReadWrite=/etc/ssh |
| 5 | ConditionPathIsSymbolicLink=!/etc/ssh |
| 6 | Before=ssh.service sshd.service [email protected] |
| 7 | |
| 8 | [Service] |
| 9 | Type=oneshot |
| 10 | RemainAfterExit=yes |
| 11 | ExecStart=ssh-keygen -A |
| 12 | |
| 13 | [Install] |
| 14 | WantedBy=ssh.service sshd.service [email protected] ssh.socket |