Skip to content
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.
/ docker-sshd Public archive

General purpose image running OpenSSH daemon for functional tests

License

Notifications You must be signed in to change notification settings

int128/docker-sshd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sshd

This is a general purpose image running SSHd for functional tests.

Getting Started

Setup keys and run a container as follows:

# Generate a key
ssh-keygen -t rsa -N '' -C '' -f id_rsa

# Generate host keys
mkdir -p etc/ssh
ssh-keygen -A -f .

# Run a container
docker run --rm -p 22:22 \
  -e "SSH_HOST_DSA_KEY=$(cat etc/ssh/ssh_host_dsa_key)" \
  -e "SSH_HOST_RSA_KEY=$(cat etc/ssh/ssh_host_rsa_key)" \
  -e "SSH_HOST_ECDSA_KEY=$(cat etc/ssh/ssh_host_ecdsa_key)" \
  -e "SSH_HOST_ED25519_KEY=$(cat etc/ssh/ssh_host_ed25519_key)" \
  -e "SSH_AUTHORIZED_KEYS=$(cat id_rsa.pub)" \
  int128/sshd

Now you can connect to the container via SSH.

ssh -o UserKnownHostsFile=known_hosts -i id_rsa tester@localhost

Usage

You need to set the following environment variables:

  • SSH_HOST_DSA_KEY - DSA host key
  • SSH_HOST_RSA_KEY - RSA host key
  • SSH_HOST_ECDSA_KEY - ECDSA host key
  • SSH_HOST_ED25519_KEY - ED25519 host key

You can set the following environment variables:

  • SSH_USERNAME - username (default: tester)
  • SSH_PASSWORD - password (default: hello)
  • SSH_AUTHORIZED_KEYS - authorized keys for the user

Releases

No releases published

Packages

No packages published