sys:повышение_безопасности_ssh_сервера

Повышение безопасности ssh сервера

Указываем:

  1. каким ключам/алгоритмам мы будем доверять,
  2. кого можно пускать по ssh
cat >> /etc/ssh/sshd_config <<EOT
 
######################################################################
#
##   Local settings
#
######################################################################
 
KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com
 
AllowUsers sabitov
 
EOT

Удаляем ключи, которым нет веры. Чтобы ssh не создавал их по новой, создаём закольцованные симлинки. Пересоздаём RSA ключ, но уже существенно большей длины. Удаляем короткие модули

cd /etc/ssh
rm /etc/ssh/ssh_host_{rsa,dsa,ecdsa}_key{,.pub} /etc/ssh/ssh_host_key{,.pub}
ln -s ssh_host_key ssh_host_key
ln -s ssh_host_dsa_key ssh_host_dsa_key
ln -s ssh_host_ecdsa_key ssh_host_ecdsa_key
ssh-keygen -t rsa -b 4096 -N '' -f ssh_host_rsa_key < /dev/null
cat /etc/ssh/moduli | awk '{ if ($5 !~ /1535|2047|3071/) print;}' > /tmp/1
cat /tmp/1 > /etc/ssh/moduli
rm /tmp/1

Dixi

/etc/init.d/sshd restart

Список литературы:

Хорошая статья на эту же тему.

dokuwiki\Exception\FatalException: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2097160 bytes)

dokuwiki\Exception\FatalException: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2097160 bytes)

An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the authplain plugin.

More info has been written to the DokuWiki error log.