•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Infrastructure
      • iColocation
    • Compute
      • cMetal
      • cVirtual
    • Storage
      • sObject
      • sBlock
    • Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • Protection
      • pBackup
      • pDDoS
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • new-colocation-header-img
      Infrastructure
      • iColocation
    • new-compute-header-img
      Compute
      • cMetal
      • cVirtual
    • new-storage-header-img
      Storage
      • sObject
      • sBlock
    • new-networking-header-img
      Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • new-protection-header-img
      Protection
      • pBackup
      • pDDoS
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

SSH into Docker Container

  • Home
  • Client
  • Qa Forum
  • SSH into Docker Container

Posted By: Ethan | 1 Replies | Last Reply On: Dec 21, 2017 02:37:28

How can i SSH into docker container? 

Psychz - Raviteja

Votes: 0Posted On: Dec 21, 2017 02:37:28
 

To SSH into the desired container, you must first install an SSH server in the image you wish to ssh-into. 
A base image can be used for all your container with the ssh server installed. Once you do this you only have to run each container mapping the ssh port (default 22) to one to the host's ports (Remote Server in your image), using -p :

For example

docker run -p 52022:22 container1 
docker run -p 53022:22 container2

 

Then, if ports 52022 and 53022 of host's are accessible from outside, you can directly ssh to the containers using the IP of the host (Remote Server) specifying the port in ssh with -p . I.e.:

ssh -p 52022 user@172.158.x.x --> SSH to container1
ssh -p 53022 user@172.158.x.x --> SSH to container2

Was this reply helpful?

Related topics

  • Smart guide to managing Docker container
  • How To Run Kubernetes on Psychz Networks Bare Metal Servers
  • Docker Container vs VM
  • Docker container vs Image
  • How to generate SSH Keys on Linux?
  • How to remotely connect to a Linux machine using a smartphone?
  • OpenShift vs. Docker
  • Unable to Access The Server Via SSH
  • LXD vs Docker
  • Docker swarm vs Kubernetes
  • Docker remove all images
  • Tools That Make Kubernetes Easier
  • Red Hat: Not just about Linux anymore!
  • Scaling your Business with a Dedicated Server and Containers
  • Most Common Linux Distros
Copyright © 2025 Psychz Networks,
A Profuse Solutions Inc Company
Hosting Services
Infrastructure
  • iColocation
Compute
  • cMetal
  • cVirtual
Storage
  • sObject
  • sBlock
Networking
  • nCDN
  • nIP Transit
  • nWavelength
Protection
  • pBackup
  • pDDoS
Company
  • About Us
  • Blog
  • Careers
  • Contact Us
  • Data Centers
  • Looking Glass
  • Network
  • Reseller
Policies
  • Acceptable Usage Policy
  • Privacy Policy
  • Service Level Agreement
  • Terms and Conditions
Support
  • Community
  • Knowledge Base
  • Open A Ticket
Get In Touch
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801