编程技术记录

世界你好!

闲暇无事看了看系统日志,发现ssh被暴力了,类似下面的日志几乎一秒一条

Oct  3 21:30:38 localhost sshd[11266]: Failed password for invalid user minecraftserver from 84.93.153.9 port 54913 ssh2

索性禁用ssh密码登陆
打开文件/etc/ssh/sshd_config,将PasswordAuthentication值修改为no

   #开启公钥算法鉴权
   PubkeyAuthentication yes
  #禁用密码鉴权
   PasswordAuthentication no
   #鉴权挑战响应
   ChallengeResponseAuthentication no

保存文件后,重启sshd服务

sudo systemctl restart sshd.service

清净多了

© Beli. All Rights Reserved.