mirror of
https://github.com/kforney/pentest-distro-builder.git
synced 2024-11-25 01:35:24 -07:00
25 lines
671 B
SYSTEMD
25 lines
671 B
SYSTEMD
|
[Unit]
|
||
|
Description=OpenSSH Server Key Generation
|
||
|
|
||
|
# Do not run if keys already exist
|
||
|
ConditionPathExistsGlob=!/etc/ssh/ssh_host_*_key
|
||
|
|
||
|
# This service requires rng-tools to feed the random number generator,
|
||
|
# otherwise we may generate predictable keys without noticing it.
|
||
|
Requires=rng-tools.service
|
||
|
After=rng-tools.service
|
||
|
|
||
|
# sshd needs this service to be run and finished before starting
|
||
|
PartOf=ssh.service ssh.socket
|
||
|
Before=ssh.service ssh.socket
|
||
|
|
||
|
[Install]
|
||
|
# sshd needs this service to be run and finished before starting
|
||
|
WantedBy=ssh.service ssh.socket
|
||
|
|
||
|
[Service]
|
||
|
EnvironmentFile=-/etc/sysconfig/sshd
|
||
|
ExecStart=/usr/bin/ssh-keygen -A
|
||
|
Type=oneshot
|
||
|
RemainAfterExit=yes
|