博客
关于我
安全强化你的 Linux 服务器的七个步骤
阅读量:196 次
发布时间:2019-02-28

本文共 1528 字,大约阅读时间需要 5 分钟。

??????Linux???????

?????????????????????????????????????????Linux??????????

1. ????????????

???????????????????????????????????????????????????????????

  • ? Ubuntu ? Debian ??

    sudo apt update && sudo apt upgrade -y
  • ? Fedora?CentOS ? RHEL ??

    sudo dnf upgrade -y

2. ??????

??????????????root??????????????????????sudo???

  • ??????

    sudo adduser
  • ??usermod????????sudo???

    sudo usermod -a -G sudo

3. ??SSH??

??SSH?????????????ssh-copy-id?????????????????

  • ???????????

    ssh-copy-id @ip_address

????????????????????

4. ????SSH??

????????????????SSH?????????

  • ??SSH?????

    ??/etc/ssh/sshd_config?????????

    PasswordAuthentication no
  • ??root?????

    PermitRootLogin no
  • ??IP?????

    ??AddressFamily?????SSH?????IPv4???

    AddressFamily inet
  • ??SSH???

    ? Ubuntu ??

    sudo service sshd restart

    ? Fedora ? CentOS ??

    sudo systemctl restart sshd

5. ?????

????????????????????????????Ubuntu??ufw????????????????

  • ??UFW?

    sudo apt install ufw -y
  • ????????

    sudo ufw allow sshsudo ufw allow httpsudo ufw allow https
  • ??????

    sudo ufw enable
  • ????????

    sudo ufw status

6. ??Fail2ban

Fail2ban??????????????????????????IP???

  • ??Fail2ban?

    sudo apt install fail2ban -y
  • ???????

    sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
  • ??Fail2ban???

    sudo service fail2ban restart
  • ?????

    sudo fail2ban-client status ssh

7. ????????

??????????????????????????ss??????????????

  • ??????????

    sudo ss -atpu
  • ?????????

    ? Debian/Ubuntu ??

    sudo apt purge

    ? Red Hat/CentOS ??

    sudo yum remove

??????????????Linux?????????????????????????????????????????????????????????????????????????????????????????????

转载地址:http://peti.baihongyu.com/

你可能感兴趣的文章
PHP的ip2long和long2ip升级函数
查看>>
PHP的json_encode函数应用到微信接口问题(include \uxxxx will create fail)
查看>>
php的web路径获取
查看>>
php的一些小笔记--字符串
查看>>
php的几种运行模式CLI、CGI、FastCGI、mod_php
查看>>
php的四大特性八大优势
查看>>
RabbitMQ
查看>>
PHP的威胁函数与PHP代码审计实战
查看>>
PHP的引用举例
查看>>
PHP相关代码
查看>>
RabbitMQ
查看>>
php知识点记录
查看>>
PHP类数组式访问(ArrayAccess接口)
查看>>
PHP系列:浅谈PHP中isset()和empty() 函数的区别
查看>>
PHP索引数组unset的坑-array_values解决方案
查看>>
PHP索引数组排序方法整理(冒泡、选择、插入、快速)
查看>>
PHP线程安全和非线程安全
查看>>
R3LIVE开源项目常见问题解决方案
查看>>
php缃戠珯,www.wfzwz.com
查看>>
php缓存查询函数
查看>>