summaryrefslogtreecommitdiff
path: root/scripts/ssh-server-key
blob: 9712393c987525776d918bfca1662d776ac1207b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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