diff --git a/util/install.sh b/util/install.sh index 958d49b..8d6d203 100755 --- a/util/install.sh +++ b/util/install.sh @@ -706,6 +706,20 @@ function vm_clean { rm -f ~/.ssh/id_rsa* ~/.ssh/known_hosts sudo rm -f ~/.ssh/authorized_keys* + # Remove SSH keys and regenerate on boot + echo 'Removing SSH keys from /etc/ssh/' + sudo rm -f /etc/ssh/*key* + if ! grep mininet /etc/rc.local >& /dev/null; then + sudo sed -i -e "s/exit 0//" /etc/rc.local + echo ' +# mininet: regenerate ssh keys if we deleted them +if ! stat -t /etc/ssh/*key* >/dev/null 2>&1; then + /usr/sbin/dpkg-reconfigure openssh-server +fi +exit 0 +' | sudo tee -a /etc/rc.local > /dev/null + fi + # Remove Mininet files #sudo rm -f /lib/modules/python2.5/site-packages/mininet* #sudo rm -f /usr/bin/mnexec diff --git a/util/vm/install-mininet-vm.sh b/util/vm/install-mininet-vm.sh index e26ba41..11632ca 100755 --- a/util/vm/install-mininet-vm.sh +++ b/util/vm/install-mininet-vm.sh @@ -43,7 +43,7 @@ fi # Install Mininet time mininet/util/install.sh # Finalize VM -time mininet/util/install.sh -tc +time mininet/util/install.sh -tcd # Ignoring this since NOX classic is deprecated #if ! grep NOX_CORE_DIR .bashrc; then # echo "export NOX_CORE_DIR=~/noxcore/build/src/" >> .bashrc