Sendmail server defense against DoS Attacks

Source: Internet
Author: User
Sendmail Server DoS attack prevention measure-Linux Enterprise Application-Linux server application information, the following is a detailed description. By setting directory limits for/etc/mail/Sendmail. mc, the validity of DoS attacks is greatly restricted. (For details, refer to the August publication "classification protection against Linux DoS"). In addition, you can use the non-root permission to run the Sendmail service, and use the xinetd-based SMTP service.
By default, the Sendmail daemon runs as a set-UID user process. If the Sendmail daemon is attacked by a buffer overflow attack, the security of the root account may be compromised. The root user has the highest permissions, and attackers can destroy the entire server. Therefore, reduce the running permission of Sendmail to a common user. The method is as follows:
A. Create A mail User name:
# Useradd mail-s/bin/false
B. modify the permissions of the files and directories used by Sendmail:
# Chown root: mail/var/spool/mail; # chmod 1775/var/spool/mail
# Chown-R: mail/var/spool/mail/*; # chmod-R 660/var/spool/mail /*
# Chown mail: mail/usr/sbin/Sendmail; # chmod 6555/usr/sbin/Sendmail
# Chown mail/var/spool/mqueue/*; chown-R mail: mail/etc/mail
# Chmod-R 664/etc/mail
C. Create a super Access Program/etc/xine. d/Sendmail for Sendmail:
Service smtp
{Socket_type = stream
Wait = no
User = mail
Group = mail
Server =/usr/sbin/Sendmail
Server_args =-bs
Log_on_success + = DURATION USERID
Log_on_failure + = USERID
Nice = 10
Disable = no}
D. Modify/etc/crontab to have the following entities:
10 *** mail/usr/sbin/Sendmail-q
Indicates that the email server runs once every 10 minutes.
E. modify the configuration file site. config. m4 and add the following content:
Define ('conftemp _ FILE_MODE ', '20140901') dnl
Define ('Alias _ file', '/etc/mail/aliases ')
F. Stop the Sendmail daemon.
G. Use "killall-USR1 xinetd" to restart the xinetd super server.
H. Run the "telnet localhost 25" command to connect to Sendmail.
I. view the running status of Sendmail. Run the following command:
# Ps aux grep Sendmai
Mail 25274 0.0 0.7 4048 1808? SN Sendmail: server
Root 25294 0.0 0.2 1520 592 ttyp0 S grep Sendmail
The above shows that Sendmail is running as a mail User. Then run the quit command. (Dongfang ruitong

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.