aboutsummaryrefslogtreecommitdiff
path: root/files/firstboot/21-generate-ssh-keys.sh
diff options
context:
space:
mode:
authorFilip Pytloun <filip@pytloun.cz>2016-03-04 14:07:10 +0100
committerFilip Pytloun <filip@pytloun.cz>2016-03-06 09:25:53 +0100
commita2923b42dbd061cd1bfe46c56dc0aff43ccb33f1 (patch)
tree338029d4b579f7b6216f4619cecd99b6c07e1a07 /files/firstboot/21-generate-ssh-keys.sh
parent33668aa2768a52add75b575263ec5dc5cec7d145 (diff)
downloadrpi2-gen-image-a2923b42dbd061cd1bfe46c56dc0aff43ccb33f1.tar.gz
rpi2-gen-image-a2923b42dbd061cd1bfe46c56dc0aff43ccb33f1.tar.bz2
rpi2-gen-image-a2923b42dbd061cd1bfe46c56dc0aff43ccb33f1.zip
Cleanup code by spliting files
Diffstat (limited to 'files/firstboot/21-generate-ssh-keys.sh')
-rw-r--r--files/firstboot/21-generate-ssh-keys.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/files/firstboot/21-generate-ssh-keys.sh b/files/firstboot/21-generate-ssh-keys.sh
new file mode 100644
index 0000000..a6c567c
--- /dev/null
+++ b/files/firstboot/21-generate-ssh-keys.sh
@@ -0,0 +1,8 @@
+logger -t "rc.firstboot" "Generating SSH host keys"
+rm -f /etc/ssh/ssh_host_*
+ssh-keygen -q -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key
+ssh-keygen -q -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key
+ssh-keygen -q -t ecdsa -N "" -f /etc/ssh/ssh_host_ecdsa_key
+ssh-keygen -q -t ed25519 -N "" -f /etc/ssh/ssh_host_ed25519_key
+
+systemctl restart sshd