Join our Newsletter — 33% off our NHI Course

Why does SSH inside Docker containers add scope instead of value?

 

(@nhi-mgmt-group)
Member Moderator
Joined: 2 years ago
Posts: 20842
Topic starter  

TL;DR: Docker containers stay minimal when access uses task-bound Docker tooling, and SSH adds a persistent login path and extra overhead, StrongDM explains. Container operations become harder to keep scoped when remote access starts looking like server administration.

Editorial analysis by NHI Mgmt Group, based on content published by StrongDM: “How to SSH into Docker Containers [Tutorial]”.

Key questions

Q: Why does running SSH inside a container usually create more risk than it removes?

A: SSH inside a container adds another service, another attack surface, and another credential path to manage.

Q: How should platform teams decide whether a container needs SSH at all?

A: Start from the operational goal and ask whether the same outcome can be achieved with docker run or docker exec.

Q: What breaks when teams rely on SSH as the normal way to access Docker containers?

A: The container becomes harder to operate as a container and easier to mismanage like a server.

Practitioner guidance

  • Prefer native Docker command execution Standardise docker run and docker exec for routine interactive operations so operators use the container's built-in execution path instead of a separate login service.
  • Avoid installing SSH by default Treat OpenSSH as an exception that requires an explicit operational justification, because it adds packages, services, and a persistent access surface to the image.
  • Review container access scope Check whether each container has become reachable through a standing administrative path that is broader than the task it is meant to perform.

Bottom line: Docker containers are intended to stay minimal, so adding SSH often changes the access model more than it changes the operator experience.

Glossary terms: Context Scope, Standing access path, Task-bound Access

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →


This topic was modified 3 weeks ago by NHI Mgmt Group

   
Quote
(@mr-nhi)
Member Moderator
Joined: 7 months ago
Posts: 21330
 

SSH inside a container is an access-scope decision, not just an administration preference. The article makes the core tradeoff plain: docker exec already supports shell-like operations without adding a daemon and network service. Once SSH is installed, the container is no longer only a workload with command access, it becomes a remotely accessible login target. For identity teams, that changes the control boundary from task execution to standing access surface.

A few things that frame the scale:

  • Red Hat’s Kubernetes Security Report found that nearly 9 in 10 organizations had at least 1 container or Kubernetes security incident in the last 12 months.

A question worth separating out:

Q: What should teams do when a container already has a standing login path?

A: Reassess the container's purpose, exposed services, and access boundaries, then determine whether the login path is actually required for support or whether it reflects inherited server habits. If it is not required, remove it and return the workload to a minimal, task-bound execution model.

👉 Read our full editorial: Docker container access patterns expose the scope tradeoff of SSH



   
ReplyQuote
Share:

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.