Skip to content

Instantly share code, notes, and snippets.

@inC3ASE
Created October 14, 2016 02:04
Show Gist options
  • Save inC3ASE/b85f306a679b8b9bcd2d3711134ac96b to your computer and use it in GitHub Desktop.
Save inC3ASE/b85f306a679b8b9bcd2d3711134ac96b to your computer and use it in GitHub Desktop.
libexec
#!/bin/sh
SSHDIR=/etc/ssh
[ ! -f ${SSHDIR}/ssh_host_key ] && ssh-keygen -q -t rsa1 -f ${SSHDIR}/ssh_host_key -N "" -C "" < /dev/null > /dev/null 2> /dev/null
[ ! -f ${SSHDIR}/ssh_host_rsa_key ] && ssh-keygen -q -t rsa -f ${SSHDIR}/ssh_host_rsa_key -N "" -C "" < /dev/null > /dev/null 2> /dev/null
[ ! -f ${SSHDIR}/ssh_host_dsa_key ] && ssh-keygen -q -t dsa -f ${SSHDIR}/ssh_host_dsa_key -N "" -C "" < /dev/null > /dev/null 2> /dev/null
[ ! -f ${SSHDIR}/ssh_host_ecdsa_key ] && ssh-keygen -q -t ecdsa -f ${SSHDIR}/ssh_host_ecdsa_key -N "" -C "" < /dev/null > /dev/null 2> /dev/null
[ ! -f ${SSHDIR}/ssh_host_ed25519_key ] && ssh-keygen -q -t ed25519 -f ${SSHDIR}/ssh_host_ed25519_key -N "" -C "" < /dev/null > /dev/null 2> /dev/null
exec /usr/sbin/sshd $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment