Skip to content

Peco602/ssh-linux-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test Push

SSH Server Linux Docker image

Run a SSH Server in a Linux container.

Why?

You might want to have an integration test environment to try it out.

Build the image

docker build -t ssh-server:latest .

Run the container

docker run -d --name ssh_server ssh-server:latest

or, if you want to expose the SSH port:

docker run -d --name ssh_server -p 2022:22 ssh-server:latest

Connect to the container via SSH

IP=$(docker inspect -f "{{ .NetworkSettings.Networks.bridge.IPAddress }}" ssh_server)
ssh user@$IP

The container SSH password is Pa$$w0rd123!.

Stop the container

docker rm --force ssh_server

DockerHub

About

Run a SSH Server in a Linux container.

Topics

Resources

License

Stars

Watchers

Forks