Created
March 19, 2020 14:45
-
-
Save maxux/c7d4590e558ef3f80e79e2ed42d5b297 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ash | |
if [ -f /etc/ssh/ssh_host_rsa_key ]; then | |
# nothing to do, hackish way | |
sleep 10 | |
exit 0 | |
fi | |
echo "Setting up sshd" | |
mkdir -p /run/sshd | |
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa | |
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa | |
ssh-keygen -f /etc/ssh/ssh_host_ecdsa_key -N '' -t ecdsa -b 521 | |
ssh-keygen -f /etc/ssh/ssh_host_ed25519_key -N '' -t ed25519 | |
chmod 700 /root/.ssh | |
chmod 600 /root/.ssh/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment