Pcornel
Automation · Linux Automation

SSH

Cheat sheet · https://pcornel.dk/topic.php?topic=5651

Back to the Topic

Answer

SSH in Linux Automation provides remote command and file-transfer reachability to Linux targets, including host-key trust, authentication, authorization, shell/session behavior and remote exit evidence.

Remember

  • TCP/22 reachable ≠ SSH host identity trusted.
  • SSH authenticated ≠ requested command authorized.
  • Interactive shell success ≠ non-interactive automation environment equivalent.
  • Remote exit code 0 ≠ desired Linux state verified.

First checks

  • ssh -o BatchMode=yes <host> true — non-interactive key auth works
  • ssh-keyscan <host> — host key collection (verify!)
  • ssh -G <host> | head — effective client config

Verify in this order

controller → SSH key auth → host → sudo

Where it usually breaks

SSH evidence establishes remote-session and command boundaries only; it does not prove that a service, package, file or workload reached the intended end state.

SSH automation proof-boundary map

BoundaryHealthy evidenceSuspicious evidence
Scope / identityExact source revision, hosts and execution identity are explicitSelector drift, stale inventory or wrong token changes scope/authority
OperationTool/provider action and per-host result are traceablePartial failure, hidden error semantics or environment differences are lost
Platform statePersistent and effective state are read backCommand/cmdlet success is mistaken for convergence
Workload proofOriginal service/application acceptance passesAutomation summary substitutes for actual runtime behavior

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5651

Confirmation

Confirm action

Continue?