HUB
Sign inSign up
sshd logo

dceoy/sshd

By dceoy

•Updated over 5 years ago

SSH server with public key authentication enabled

Image
0

1.2K

dceoy/sshd repository overview

⁠docker-sshd

Dockerfile for SSH server with public key authentication enabled

⁠Docker image

Pull the image from Docker Hub⁠

$ docker pull dceoy/sshd

⁠Usage

  1. Check out the repository.

    $ git clone https://github.com/dceoy/docker-sshd.git
    $ cd docker-sshd
    
  2. Create public/private RSA key pair.

    $ docker-compose run --rm --entrypoint=/usr/bin/ssh-keygen --volume=${PWD}/keys:/root/.ssh sshd -t rsa
    

    If you use an already-existing pair, copy the public key file into keys/ instead of the above step.

  3. Create a symlink to the public key file with SSH username root.

    $ ln -s id_rsa.pub keys/root
    
  4. Run an SSH server

    $ docker-compose up
    
  5. Connect to the SSH server with the private key

    $ ssh -i keys/id_rsa -p 2222 [email protected]
    

Tag summary

Content type

Image

Digest

Size

39.7 MB

Last updated

over 5 years ago

docker pull dceoy/sshd