A test SSH server that uses keyboard-interactive authentication and listens on port 4444.
For comprehensive testing instructions and automated setup, see TESTING_GUIDE.md.
# Start complete development environment
./start-dev.sh
# Test SSH connection
./test-connection.sh
# Stop all services
./stop-dev.shWe provide three Docker configurations for different testing scenarios:
- Dockerfile - Basic SSH server with keyboard-interactive authentication
- Dockerfile.debug - SSH server with password authentication and debug logging (recommended)
- Dockerfile.password - SSH server with standard password authentication
# Use the Debian Bullseye Slim image as the base
FROM debian:bullseye-slim
# Install the necessary packages
# Use the Debian Bullseye Slim image as the base
FROM debian:bullseye-slim
# Install the necessary packages
RUN apt-get update && \
apt-get install htop -y --no-install-recommends \
openssh-server && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Configure SSH server
RUN mkdir /var/run/sshd && \
sed -i 's/^ChallengeResponseAuthentication no/ChallengeResponseAuthentication yes/' /etc/ssh/sshd_config && \
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && \
echo 'Port 4444' >> /etc/ssh/sshd_config && \
echo 'UsePAM yes' >> /etc/ssh/sshd_config && \
echo 'AuthenticationMethods keyboard-interactive' >> /etc/ssh/sshd_config
# Add a test user with a password
RUN useradd -m testuser && \
echo "testuser:testpassword" | chpasswd
# Expose port 4444
EXPOSE 4444
# Start the SSH server
CMD ["/usr/sbin/sshd", "-D", "-e"]-
Build the Docker image:
docker build -t keyboard-ssh-server . -
Run the container:
docker run --rm -p 4444:4444 --name keyboard-ssh-server keyboard-ssh-server
This Dockerfile sets up an SSH server that listens on port 4444 and uses keyboard-interactive authentication. The testuser has been created with the password testpassword.
You can connect to this SSH server using the following command:
ssh -p 4444 testuser@localhostYou'll be prompted for a password as part of the keyboard-interactive authentication process.
- Host: localhost
- Port: 4444
- Username: testuser
- Password: testpassword
The provided scripts automate the entire development setup:
- start-dev.sh - Starts Docker SSH server, WebSSH2 server, and client in separate tmux sessions
- stop-dev.sh - Stops all services and cleans up
- test-connection.sh - Tests SSH connectivity to ensure the server is working
See TESTING_GUIDE.md for detailed tmux usage and troubleshooting.