Recover from SSH, Docker, and Timeout Failures¶
Read Error & Alert Matrix before you start.
Prerequisites¶
- Confirm shell access on the audit controller host.
- Collect the target key, transport flags, and
stderrtext.
Safety Instructions¶
CAUTION: Never add 2>/dev/null to diagnostic commands.
Masked stderr hides TIMEOUT, MISSING_BINARY, and PERMISSION_DENIED
faults.
CAUTION: Verify change approval before you start a stopped database container. An unapproved container start can disrupt cluster quorum or lock data files.
Procedure¶
- Set mode
0600on the SSH private key (chmod 0600 ~/.ssh/id_ed25519). - Test non-interactive SSH access on the target port:
- If
PERMISSION_DENIEDor code126occurs, test passwordlesssudo -n:
- Re-run the remote SSH audit with
--ssh-port,-i, and--sudo:
python3 audit_cis.py -t rhel9 -m ssh -r admin@192.168.1.50 --ssh-port 2222 -i ~/.ssh/id_ed25519 --sudo -f json -o reports/rhel9.json
- If Docker reports
CONNECTION_ERROR, inspect container state:
- If
docker inspectprintsfalse, rundocker start prod-pg17after approval. - Re-run the local or remote container audit with
-c:
python3 audit_cis.py -t postgresql17 -c prod-pg17 -f json -o reports/pg17.json
python3 audit_cis.py -t postgresql17 -r admin@192.168.1.50 --ssh-port 2222 -i ~/.ssh/id_ed25519 -c prod-pg17 -f json -o reports/pg17_ssh.json
- If
MISSING_BINARYor code127occurs, verify client binaries on the target:
Install the missing client package on the target host or container.
- If
TIMEOUTor code-1occurs, inspect host load withuptimeandss -tlnp. Re-run one single target after host load drops.
NOTE: SSH drivers enforce BatchMode=yes and ConnectTimeout=10 to avoid
interactive hangs.
Verification¶
- Confirm that
audit_cis.pyexits with code0. - Confirm zero
Errorentries inreports/pg17_ssh.json:
python3 -c "import json; r=json.load(open('reports/pg17_ssh.json')); rows=r['results'] if isinstance(r['results'],list) else sum(r['results'].values(),[]); assert not [x for x in rows if str(x.get('status','')).upper()=='ERROR']"
- Run transport and diagnostic unit tests:
Rollback¶
- If maintenance policy requires a halt, stop containers started for diagnostics.
- Revert temporary
sudoersrules or firewall overrides on the remote host. - Delete temporary JSON files from
reports/. - Escalate persistent SSH or Docker daemon outages to platform operations.