
How to Audit SSH Logins and Failed Attempts the Safe Way
Audit SSH logins on Linux: read auth logs and the journal, count failed attempts, list successful logins by key, spot invalid users and raise the log level.
Tag
39 posts

Audit SSH logins on Linux: read auth logs and the journal, count failed attempts, list successful logins by key, spot invalid users and raise the log level.

Fix a Python subprocess that hangs: pipe buffer deadlocks with wait, missing communicate, stdin prompts, timeouts, and killing process groups.

Understand API 502 Bad Gateway and 504 Gateway Timeout from scripts and proxies: where they come from, what to check upstream, and safe retries.

Handle API 429 Too Many Requests in scripts: read Retry-After and rate limit headers, exponential backoff with jitter, curl retries, throttling and batching.

Fix Bats errors: bats command not found, load: command not found, helper libraries not found, bats-core install methods, PATH, submodules and CI setup.

Decode shell exit codes 126, 127, 130 and 137, plus segfault status 139: what each means, how to confirm the cause and what to do about it.

Fix GitHub Actions permission denied on a script: the executable bit, git update-index, shebang and line endings, noexec mounts, and how to call with bash.

Fix command not found in cron: the short PATH, tools installed in user directories, version managers, sudo, absolute paths, and how to prove the cause.

Find why a cron job is not running: the daemon, the schedule, the crontab file, permissions, PATH, percent signs and output, with a numbered checklist.

Fix SSH no matching host key type found: why SHA-1 ssh-rsa was disabled, reading the server offer, HostKeyAlgorithms overrides, and re-keying.

Fix SSH no matching key exchange method found: read the server offer, old server versus new client, safe KexAlgorithms overrides and upgrades.

Fix the SSH unprotected private key file warning: set mode 600, fix ownership, handle WSL and Windows mounts, and see why open keys are refused.