28 lines
942 B
Bash
28 lines
942 B
Bash
#!/bin/bash
|
|
export PATH=$PATH:/usr/local/go/bin
|
|
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---"
|
|
/etc/rc.d/rc.sshd start
|
|
sleep 2
|
|
echo "---Build Container fully startet, connect to it via SSH on port 8022---"
|
|
sleep infinity |