-
-
Save ambakshi/6a65438532cf457c030a6cf5fd60192c to your computer and use it in GitHub Desktop.
Systemd unit to generate missing ssh keys on boot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Generate sshd keys | |
Before=ssh.service | |
ConditionPathExists=!/etc/ssh/ssh_host_rsa_key | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/bin/ssh-keygen -A | |
RemainAfterExit=true | |
StandardOutput=journal | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment