updated go
This commit is contained in:
parent
54385b98cd
commit
94d11f34ee
2 changed files with 9 additions and 28 deletions
|
|
@ -9,30 +9,6 @@ read answer
|
|||
|
||||
[ "${answer}" != "y" ] && exit 0
|
||||
|
||||
ssh_moduli="/etc/ssh/moduli"
|
||||
moduli="/etc/moduli"
|
||||
if [ -f ${ssh_moduli} ]; then
|
||||
echo "filtering safe primes"
|
||||
awk '$5 > 2000' ${ssh_moduli} > /tmp/moduli
|
||||
mv /tmp/moduli ${ssh_moduli}
|
||||
elif [ -f ${moduli} ]; then
|
||||
echo "filtering safe primes"
|
||||
awk '$5 > 2000' ${moduli} > /tmp/moduli
|
||||
mv /tmp/moduli ${moduli}
|
||||
else
|
||||
echo "generating safe primes"
|
||||
echo "warning: this can take a long time (2h+)"
|
||||
echo -n "continue? [n/Y] "
|
||||
read answer
|
||||
if [ "${answer}" == "n" ]; then
|
||||
exit 0
|
||||
fi
|
||||
ssh-keygen -G ${ssh_moduli}.all -b 4096 > /dev/null
|
||||
ssh-keygen -T ${ssh_moduli}.safe -f ${ssh_moduli}.all > /dev/null
|
||||
mv ${ssh_moduli}.safe ${ssh_moduli}
|
||||
rm ${ssh_moduli}.all
|
||||
fi
|
||||
|
||||
echo "cleaning ssh host keys"
|
||||
rm /etc/ssh/ssh_host_{ecdsa,dsa,dss}_key* 2>/dev/null
|
||||
[ ! -f /etc/ssh/ssh_host_ed25519_key ] && ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N "" > /dev/null
|
||||
|
|
@ -45,9 +21,12 @@ echo "writing ssh config"
|
|||
cat <<EOF> ${ssh_config}
|
||||
HostKey /etc/ssh/ssh_host_ed25519_key
|
||||
HostKey /etc/ssh/ssh_host_rsa_key
|
||||
KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
|
||||
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com
|
||||
MACs umac-128-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com
|
||||
HostKeyAlgorithms ssh-ed25519,rsa-sha2-512
|
||||
PubkeyAcceptedAlgorithms ssh-ed25519,rsa-sha2-512
|
||||
KexAlgorithms sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org
|
||||
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com
|
||||
MACs hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com
|
||||
Compression no
|
||||
PermitRootLogin no
|
||||
ChallengeResponseAuthentication no
|
||||
PasswordAuthentication no
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue