Configuration instructions for enhancing Linux operating system security

Source: Internet
Author: User
Tags ssh port

As we all know, network security is a very important topic, and servers are the most critical link in network security. Linux is considered to be a safer Internet server. As an open-source operating system, once a security vulnerability is found in Linux, volunteers from around the world on the Internet will actively fix it. However, system administrators often cannot obtain and correct information in a timely manner, which gives hackers an opportunity. Compared with the security vulnerabilities of these systems, more security problems are caused by improper configuration, which can be prevented by appropriate configuration. The following is a simple list of the following points for your reference:

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.