LAMP-based reinforcement (III)

Source: Internet
Author: User
Tags ssh port
# Rpm-a -- testrpmname: detects possible conflicts in the deleted package. 22. disable dangerous php functions to prevent high webshell performance.

21. delete unused rpm packages
# Rpm-qa list Installation List
# Rpm-qi rpmname more trusted information
# Rpm-a -- test rpmname check possible conflicts when deleting a package
22. disable dangerous php functions to prevent high webshell permissions.
23. install and configure the firewall.
24. install and configure BFD (brute-force cracking detection): You must install the TDs firewall.
25. kernel reinforcement (sysctl. conf)
Avoid DOS and spoofing attacks
# Vi/etc/sysctl. conf
26. change the ssh Port
# Vi/etc/ssh/sshd_config Port xxx
27./tmp,/var/tmp,/dev/shm partition security. do not perform operations on temporary directories.
Mount noexec nosuid
/Tmp Directory:
# Cd/dev
# Dd if =/dev/zero of = tmpMnt bs = 1024 count = 100000
# Mke2fs/dev/tempMnt
# Cp-R/tmp/tmp_backup backup temporary files
# Mount-o loop, rw, nosuid, noexec/dev/tmpMnt // tmp
# Chmod 777/tmp
# Cp-R/tmp_backup/*/tmp
# Rm-rf/tmp_backup
# Vi/etc/fstab
/Dev/tmpMnt/tmp ext2 loop, rw, nosuid, noexec 0 0
/Var/tmp Directory:
# Mv/var/tmp/var/tmpbak
# Ln-s/tmp/var/tmp
Cp/tmp/bak/*/tmp/
/Dev/shm Directory:
# Vi/etc/fstab
Add nosuid and noexec fields
# Mount-
27. install the snort detection system in PHP IDs
28. DoS deflate-defend against/mitigate DDOS attacks in Linux
# Wget http://www.inetbase.com/scripts/ddos/install.sh
# Chmod + x install. sh
#./Install. sh
#/Usr/local/ddos. conf APF_BAN = 0
#/Usr/local/ddos. sh -- cron
/Usr/local/ddos/ignore. ip. list whitelist
127.0.0.1
10.2.4.4
10.2.4.6
10.2.4.8
10.2.4.9
10.2.4.10
10.2.4.11
10.2.4.12
Comment out this line in row 134th of/usr/local/ddos. sh and add the '#' sign before it.
Modify row 117
Netstat-ntu | awk '{print $5}' | \
Egrep-o "[0-9] {1, 3 }\. [0-9] {1, 3 }\. [0-9] {1, 3 }\. [0-9] {1, 3} "| \
Sort | uniq-c | sort-nr> $ BAD_IP_LIST
29. apache vhosts:
Php_admin_value open_basedir/wwwroot/phpMyAdmin/:/tmp/prevents cross-directory webshell

Author: www.phpdesigner.org ReferCon

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.