博客
关于我
安全强化你的 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/

你可能感兴趣的文章
No resource identifier found for attribute 'srcCompat' in package的解决办法
查看>>
node.js 配置首页打开页面
查看>>
node.js+react写的一个登录注册 demo测试
查看>>
Node.js安装与配置指南:轻松启航您的JavaScript服务器之旅
查看>>
nodejs libararies
查看>>
nodejs-mime类型
查看>>
Node入门之创建第一个HelloNode
查看>>
NotImplementedError: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty()
查看>>
npm run build 失败Compiler server unexpectedly exited with code: null and signal: SIGBUS
查看>>
npm和yarn的使用对比
查看>>
npm报错unable to access ‘https://github.com/sohee-lee7/Squire.git/‘
查看>>
npm的问题:config global `--global`, `--local` are deprecated. Use `--location=global` instead 的解决办法
查看>>
NR,NF,FNR
查看>>
nrf开发笔记一开发软件
查看>>
NSDateFormatter的替代方法
查看>>
NSOperation基本操作
查看>>
NSSet集合 无序的 不能重复的
查看>>
NT AUTHORITY\NETWORK SERVICE 权限问题
查看>>
ntko文件存取错误_苹果推送 macOS 10.15.4:iCloud 云盘文件夹共享终于来了
查看>>
nullnullHuge Pages
查看>>