This repository has been archived on 2021-12-26. You can view files and clone it, but cannot push or open issues or pull requests.
Files
docker-debian-playground/scripts/start-server.sh

32 lines
1.3 KiB
Bash

#!/bin/bash
if [ ! -d ${DATA_DIR}/.ssh ]; then
mkdir -p ${DATA_DIR}/.ssh
fi
if [ ! -f ${DATA_DIR}/.ssh/ssh_host_rsa_key ]; then
echo "---No ssh_host_rsa_key found, generating!---"
ssh-keygen -f ${DATA_DIR}/.ssh/ssh_host_rsa_key -t rsa -b 4096 -N ""
else
echo "---ssh_host_rsa_key keys found!---"
fi
if [ ! -f ${DATA_DIR}/.ssh/ssh_host_ecdsa_key ]; then
echo "---No ssh_host_ecdsa_key found, generating!---"
ssh-keygen -f ${DATA_DIR}/.ssh/ssh_host_ecdsa_key -t ecdsa -b 521 -N ""
else
echo "---ssh_host_ecdsa_key found!---"
fi
if [ ! -f ${DATA_DIR}/.ssh/ssh_host_ed25519_key ]; then
echo "---No ssh_host_ed25519_key found, generating!---"
ssh-keygen -f ${DATA_DIR}/.ssh/ssh_host_ed25519_key -t ed25519 -N ""
else
echo "---ssh_host_ed25519_key found!---"
fi
echo "---Starting ssh daemon---"
/usr/sbin/sshd -f ${DATA_DIR}/sshd_config
sleep 2
echo "----------------------------------------------------------------------"
echo "---Container fully started connect to it by typing in your console:---"
echo "-------------'docker exec -ti NAMEOFCONTAINER /bin/bash'--------------"
echo "----------------------------------------------------------------------"
echo "------------To login as normal user type then: 'su $USER'-------------"
echo "----------------------------------------------------------------------"
sleep infinity