summaryrefslogtreecommitdiff
path: root/scripts/ssh-server-key
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/ssh-server-key')
-rwxr-xr-xscripts/ssh-server-key15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/ssh-server-key b/scripts/ssh-server-key
new file mode 100755
index 0000000..9712393
--- /dev/null
+++ b/scripts/ssh-server-key
@@ -0,0 +1,15 @@
+regen_host_keys ()
+{
+ sudo /bin/rm -v /etc/ssh/ssh_host_*
+ sudo dpkg-reconfigure openssh-server
+ sudo /etc/init.d/ssh restart
+}
+
+while true; do
+ read -p "Do you really want to remove the existing SSH host keys? " yn
+ case $yn in
+ [Yy]* ) regen_host_keys; break;;
+ [Nn]* ) exit;;
+ * ) echo "Please answer yes or no.";;
+ esac
+done