summaryrefslogtreecommitdiff
path: root/recipes-connectivity/openssh/openssh/sshdgenkeys.service
blob: 148e6ad63a1a7782879e72d8a32a4e8a597e926c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[Unit]
Description=OpenSSH Key Generation
RequiresMountsFor=/var /run
ConditionPathExists=!/var/run/ssh/ssh_host_rsa_key
ConditionPathExists=!/var/run/ssh/ssh_host_dsa_key
ConditionPathExists=!/var/run/ssh/ssh_host_ecdsa_key
ConditionPathExists=!/var/run/ssh/ssh_host_ed25519_key
ConditionPathExists=!/etc/ssh/ssh_host_rsa_key
ConditionPathExists=!/etc/ssh/ssh_host_dsa_key
ConditionPathExists=!/etc/ssh/ssh_host_ecdsa_key
ConditionPathExists=!/etc/ssh/ssh_host_ed25519_key

[Service]
Environment="SYSCONFDIR=/etc/ssh"
EnvironmentFile=-/etc/default/ssh
ExecStart=@BASE_BINDIR@/mkdir -p $SYSCONFDIR
ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_rsa_key -N '' -t rsa
ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_dsa_key -N '' -t dsa
ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_ecdsa_key -N '' -t ecdsa
ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_ed25519_key -N '' -t ed25519
Type=oneshot
RemainAfterExit=yes