Last active
July 7, 2023 12:32
-
-
Save bgulla/36858dbb68533148d5333dd14de24f51 to your computer and use it in GitHub Desktop.
Proxmox script to fix WebVNC after an IP change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## https://forum.proxmox.com/threads/console-failed-to-connect-to-server-host-key-verification-failed.78957/ | |
# Usage: ./proxmox_webvnc_fix.sh <shorthostname> | |
# Notes: may need to run twice for the fix to take. | |
set -e | |
DOMAIN="lark.lol" | |
if [ $# -eq 0 ]; then | |
echo "No hostname provided. Exiting..." | |
exit 1 | |
fi | |
HOST=${1} | |
IP=`host ${HOST} | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'` | |
echo " ${IP} belongs to ${HOST}" | |
ssh-keygen -f "/etc/ssh/ssh_known_hosts" -R "${HOST}" | |
# perform the fix | |
yes | /usr/bin/ssh -e none -o "HostKeyAlias=${HOST}" root@${IP} /bin/true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment