- Get clone of this repo.
git clone git@github.com:ykocaman/ubuntu-superssh.git
cd ubuntu-superssh
- copy your id_rsa.pub to ssh/know_hosts if you want.
cat ~/.ssh/id_rsa.pub > ssh/known_hosts
OR
after running container, you can update ssh key.
copy-ssh-id user@IP.ADD.RE.SS
- build docker image.
docker build --rm -t ykocaman/ubuntu-superssh:latest .
- run image.
docker run -d --name superssh ykocaman/ubuntu-superssh
OR
1-4) get quickly this image from docker hub.
docker run -d ykocaman/ubuntu-superssh
- connect to your sweet docker container.
ssh user@172.17.0.2
if you didnt change password from Dockerfile line 19, default password is "user".
Extras:
with docker-compose you can create multiple containers easily.
docker-compose up -d
to remove
docker-compose down
for ip addresses of all containers
docker inspect -f '{{.Name}} - {{.NetworkSettings.IPAddress }}' $(docker ps -aq)