Skip to content

maxivak/docker-base-phusion-ssh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Docker image with SSH server

  • based on phusion base Docker image

includes

  • ssh server
  • docker.io client utility to connect to other docker containers on host

Run

  • build
docker build -t base-phusion-ssh github.com/maxivak/base-phusion-ssh
  • run container
docker run -d --name my-ssh \
-p 8022:22 \
-v /var/run/docker.sock:/var/run/docker.sock \
base-phusion-ssh /sbin/my_init
  • change root password
PASS='newpass'
echo -e "$PASS\n$PASS" | docker exec -i my-ssh passwd

or using script

docker exec my-ssh bash -c "/etc/change_root_pwd.sh 'newpass' " 
  • login by ssh
ssh -p 8022 root@localhost

enter root login and enter container

  • access other Docker containers on the host
ssh -p 8022 root@localhost


root@145b03e2f6e7:~# docker ps

# see the list of docker container on the host

About

Docker image with SSH server and docker.io

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages