Skip to content

ayoubeddafali/Docker-SSH

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

UbuntuDockerAyman

What to do :

Run the container :

  $ docker run -d -P -e SSH_KEY='YOUR PUB KEY' ayoubensalem/ayman

Get the container ip :

  $ docker inspect CONTIAINER_ID | jq -r ".[0].NetworkSettings.Networks.bridge.IPAddress"

Try to ssh into it :

  $ ssh ayman@CONTAINER_IP

RUN THIS COMMAND :

  $ ssh-keygen

When done, copy the PUB KEY generated and in the host type this command:

  $ echo "PUB_KEY" >> authorized_keys

Make sur that the authorized_keys has 644.

And now, you could be able to ssh from the container to the host.

About

SSH Established Host <--> Container

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages