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