diff options
author | Chris Freas <code@packetbusters.net> | 2017-03-03 10:51:30 -0500 |
---|---|---|
committer | Chris Freas <code@packetbusters.net> | 2017-03-03 10:51:30 -0500 |
commit | 59a22f722a98a66f94ee5ff65f10a8e20d79181c (patch) | |
tree | 25d0d1d7cc9dbef8bb53ace7a9c82fcb5cb317f1 /scripts | |
parent | 40d5341bd0f4e5ceb10c82ab8e6794c08f509f62 (diff) | |
download | vyatta-op-59a22f722a98a66f94ee5ff65f10a8e20d79181c.tar.gz vyatta-op-59a22f722a98a66f94ee5ff65f10a8e20d79181c.zip |
T283: add CLI command to regenerate SSH server host keys
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/ssh-server-key | 15 |
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 |