„scripts/start-server.sh“ ändern

This commit is contained in:
2021-12-26 14:07:40 +01:00
parent ba721e687e
commit 0a73adeb3d

View File

@@ -1,4 +1,28 @@
#!/bin/bash
if [ ! -d /root/.ssh ]; then
mkdir -p /root/.ssh
fi
if [ ! -f /root/.ssh/ssh_host_rsa_key ]; then
echo "---No ssh_host_rsa_key found, generating!---"
ssh-keygen -f /root/.ssh/ssh_host_rsa_key -t rsa -b 4096 -N ""
else
echo "---ssh_host_rsa_key keys found!---"
fi
if [ ! -f /root/.ssh/ssh_host_ecdsa_key ]; then
echo "---No ssh_host_ecdsa_key found, generating!---"
ssh-keygen -f /root/.ssh/ssh_host_ecdsa_key -t ecdsa -b 521 -N ""
else
echo "---ssh_host_ecdsa_key found!---"
fi
if [ ! -f /root/.ssh/ssh_host_ed25519_key ]; then
echo "---No ssh_host_ed25519_key found, generating!---"
ssh-keygen -f /root/.ssh/ssh_host_ed25519_key -t ed25519 -N ""
else
echo "---ssh_host_ed25519_key found!---"
fi
echo "---Starting ssh daemon---"
/usr/sbin/sshd
sleep 2
echo "----------------------------------------------------------------------"
echo "---Container fully started connect to it by typing in your console:---"
echo "-------------'docker exec -ti NAMEOFCONTAINER /bin/bash'--------------"