19 lines
569 B
SYSTEMD
19 lines
569 B
SYSTEMD
|
[Unit]
|
||
|
Description=SSH RSA1 Keygeneration.
|
||
|
After=syslog.target
|
||
|
Before=sshd.service
|
||
|
ConditionPathExists=!/etc/ssh/ssh_host_key
|
||
|
|
||
|
[Service]
|
||
|
Type=oneshot
|
||
|
EnvironmentFile=/etc/sysconfig/sshd
|
||
|
ExecStart=/usr/bin/ssh-keygen -q -t rsa1 -f /etc/ssh/ssh_host_key -C '' -N ''
|
||
|
ExecStartPost=/bin/chown root:ssh_keys /etc/ssh/ssh_host_key
|
||
|
ExecStartPost=/bin/chmod 640 /etc/ssh/ssh_host_key
|
||
|
ExecStartPost=/bin/chmod 644 /etc/ssh/ssh_host_key.pub
|
||
|
ExecStartPost=/sbin/restorecon /etc/ssh/ssh_host_key /etc/ssh/ssh_host_key.pub
|
||
|
RemainAfterExit=yes
|
||
|
|
||
|
[Install]
|
||
|
WantedBy=multi-user.target
|