Skip to main content

Module 12: SSH in Modern and Containerized Environments

Chapter 43: SSH in Docker, Podman, and Docker Compose

In this chapter, you'll learn how SSH works in containerized environments, when to use SSH versus kubectl exec, and how to set up SSH access in Docker, Podman, and Docker Compose.

In the previous chapter, you learned how to use pssh and GNU Parallel to run SSH commands on multiple servers at the same time.

You also learned how to rotate SSH keys safely without locking yourself out, and how to audit and remove SSH access when it's no longer needed. That completed Module 11.

Now, welcome to Module 12, where you'll learn how SSH works in modern containerized environments.

Containers have changed the way applications are built and deployed, and they've also changed how SSH should be used.

The way you access and manage a traditional Linux server is different from how you work with containers.

Understanding when SSH makes sense inside a container and when it doesn't will help you avoid common design, security, and maintenance mistakes.

Installing Docker, Podman, and Docker Compose

Updated on Jul 8, 2026