
SSH Host Key Verification Failed Explained With Every Cause
Understand SSH Host key verification failed: every cause, from a changed key or unwritable known_hosts to a non-interactive session, with the fix for each.
Tag
39 posts

Understand SSH Host key verification failed: every cause, from a changed key or unwritable known_hosts to a non-interactive session, with the fix for each.

Fix exec format error with Go binaries: GOOS and GOARCH mismatches, building on Mac for Linux, Docker platform flags, and how to check a binary with file.

Fix Go cannot find package errors: go.mod and modules, GO111MODULE, running from the wrong directory, go mod tidy, private modules and vendoring.

Fix ShellCheck SC2016, expressions do not expand in single quotes: when it is a real bug, when the single quotes are right, and how to mix quoting.

Fix the regex unterminated character class error: unclosed brackets, a literal closing bracket placed first, POSIX class syntax and quoting.

Handle Python CalledProcessError from subprocess.run: read returncode, stdout and stderr, understand exit codes, and decide when to use check.

API errors 401 versus 403: authentication versus authorisation, headers and bodies to read, how a script should react and when not to retry.

Fix go command not found after installing Go on Linux: extract to /usr/local, add /usr/local/go/bin to PATH, reload the shell, and check for leftovers.

Fix SSH Too many authentication failures: the agent offers every key, MaxAuthTries runs out, IdentitiesOnly and IdentityFile fix it, and how to see the order.

Handle the SSH warning about a changed host identification: legitimate causes, verifying the new key, and removing the old entry with ssh-keygen -R.

Fix PostgreSQL role does not exist: createuser, psql defaults to your OS user, the missing database error, quoting case-sensitive names and idempotent setup.

Fix ShellCheck SC2006: replace backticks with $(...) for command substitution, see why nesting and quoting differ, and convert old scripts safely.