Pcornel
Automation · Network Automation

SSH Automation

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

Back to the Topic

Answer

SSH Automation uses authenticated encrypted sessions to execute network management operations, commonly CLI commands or subsystem protocols, against selected devices.

Remember

  • TCP/22 reachable ≠ SSH authenticated.
  • SSH authenticated ≠ command authorized.
  • Host-key acceptance ≠ host identity trustworthy when trust-on-first-use or stale keys are involved.
  • Command exit/channel success ≠ intended network state.

First checks

  • ssh -o BatchMode=yes <user>@<device> 'show version' — SSH works non-interactively
  • Host key verification — security
  • Netmiko/Scrapli/ansible network_cli — libraries

Verify in this order

controller → SSH → device CLI

Where it usually breaks

SSH proves a management transport/session boundary; it does not prove command semantics, configuration persistence or network service correctness.

SSH Automation Network Automation proof-boundary map

BoundaryHealthy evidenceSuspicious evidence
Intent / scopeSource revision and exact targets are explicitStale inventory, hidden selector or wrong variables change scope
Management operationTransport/model/payload and per-device response are traceableAuth/capability/parser differences hide partial or wrong execution
Device stateEffective and persistent state are read backAccepted config/API result is mistaken for convergence
Network proofOriginal control/data-plane or service test passesAutomation summary substitutes for actual network acceptance

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

Confirmation

Confirm action

Continue?