openssh/ssh-keygen-rsa.service
2011-04-23 09:13:06 +02:00

19 lines
592 B
Desktop File

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