Some necessary processing work after installation of CentOS

Source: Internet
Author: User

1 Permanently close SELinux, modify to permissive or disabled (recommended), modify the need to restart

2 Configuring Network

3. Disable ping (optional, generally do not need to prohibit) (default is 0-bit enable ICMP protocol, 1 is forbidden), no restart required after modification

    1. [[email protected] ipv4]# echo "1" >/proc/sys/net/ipv4/icmp_echo_ignore_all

Or add a sysctl.conf in the

    1. [Email protected] ~]# echo "net.ipv4.icmp_echo_ignore_all=1" >>/etc/sysctl.conf
    2. [Email protected] ~]# tail-1/etc/sysctl.conf
    3. Net.ipv4.icmp_echo_ignore_all=1
    4. [Email protected] ~]# sysctl-p

(optional) Display the message after logging in, enter the information that needs to be displayed after login

    1. [Email protected] ~]# echo "It is product Environment,be careful ..." >/ETC/MOTD

5. Modify the default SSH settings to increase system security
Backing Up Sshd_config files

[email protected] ssh]# cp/etc/ssh/sshd_config/etc/ssh/sshd_config.bak.20150915

Modify the following configuration

      1. //Modify the default port    for SSH remote connection;
      2. #Port  22  
      3. Modify to   
      4. port 2510 port number to specify   
      5.    
      6. //ssh does not allow root user login   
      7. #PermitRootLogin  yes  
      8. Modify to   
      9. PERMITROOTLOGIN NO  
      10.   
      11. //resolves the problem of slow DNS resolution   
      12. #UseDNS  yes  
      13. modified to   
      14. usedns no  
      15.   
      16. //Resolve ssh slow problem   
      17. #GSSAPIAuthentication  no  
      18. gssapiauthentication yes  
      19. Modify to   
      20. gssapiauthentication no  
      21. #GSSAPIAuthentication  yes  

6. Optimized terminal timeout, automatic disconnection of terminal over 600 seconds

    • [Email protected] ~]# echo "Export tmout=600" >>/etc/profile
    1. [Email protected] ~]# tail-1/etc/profile
    2. Export tmout=600
    3. [Email protected] ~]# Source/etc/profile

7. Control History Command record number, History command file path: ~/.bash_history

    1. [Email protected] ~]# echo "Export histsize=20" >>/etc/profile
    2. [Email protected] ~]# echo "Export histfilesize=20" >>/etc/profile
    3. [Email protected] ~]# Tail-2/etc/profile
    4. Export HISTSIZE=20
    5. Export HISTFILESIZE=20
    6. [Email protected] ~]# Source/etc/profile

Some necessary processing work after installation of CentOS

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.