openssh/ssh-keygen-rsa1.service

19 lines
569 B
Desktop File

[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