Six steps for security configuration in Linux

Source: Internet
Author: User
1. use a firewall to close unnecessary ports. if others cannot PING the server, the threat is reduced by more than half to prevent others from pinging the server. (1) open a command prompt and press echo1 & gt; /proc/sys/net/ipv4/icmp_ignore_all2) use the firewall to disable (or discard) icmp packets iptables-AINPUT-p

1. use a firewall to close unnecessary ports. if someone else fails to PING the server, the threat is naturally reduced by more than half.

Methods to prevent ping by others:

1) at the command prompt

Echo 1>/proc/sys/net/ipv4/icmp_ignore_all

2) use a firewall to prohibit (or discard) icmp packets

Iptables-a input-p icmp-j DROP

3) do not respond to all ICMP packets

For example, ping tracert.

2. change the SSH port to over 10000, and the chances of others scanning the port will also decrease.

Vi/etc/ssh/sshd_config

Change PORT to PORT 1000 or above

Create a common logon user and cancel direct root logon.

Useradd username

Passwd username

Vi/etc/ssh/sshd_config

Add the following sentence at the end:

PermitRootLogin no # cancel root direct remote login

3. delete redundant accounts with a bloated system: userdel adm userdel lp userdel sync userdel shutdown userdel halt userdel news userdel uucp userdel operator userdel games userdel gopher userdel ftp if you do not allow anonymous FTP, delete this user account groupdel adm groupdel lp groupdel news groupdel uucp groupdel games groupdel dip groupdel pppusers

4. change the following file permissions so that no one has the permission to change the account: chattr + I/etc/passwd chattr + I/etc/shadow chattr + I/etc/group chattr + I/etc/gshadow

5. chmod 600/etc/xinetd. conf

6. disable anonymous FTP user login


 

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.