search
HomeComputer TutorialsComputer KnowledgeAfter installing the Linux system, what basic configurations need to be done?

After installing the Linux system, what basic configurations need to be done?

CentOS is a popular Linux distribution widely used in the server field. Before preparing to put the newly installed CentOS system into production, we must perform some basic configuration. These configurations are designed to ensure system security and stability.

1. Reinforce the system

1.1 Change default password

By default, the root user password of CentOS system is "centos". To improve security, use the passwd command to change the default password.

passwd root

1.2 Restrict root user login

To further improve security, you can restrict the root user to only log in through SSH, and prohibit the root user from logging in directly to the system console.

Edit file:/etc/ssh/sshd_config

Find the following line:

PermitRootLogin yes

Modify it to:

PermitRootLogin no

Restart SSH service:

systemctl restart sshd

1.3 Install security software

You can install some security software, such as:

Fail2ban: Can help defend against brute force attacks.

Rkhunter: Can help scan your system for potential security vulnerabilities.

Lynis: Can help conduct a comprehensive system security audit.

You can use the yum command to install security software:

yum install fail2ban rkhunter lynis

1.4 Configure firewall

CentOS system uses firewalld firewall by default. Firewall rules can be configured using the firewalld command.

Allow SSH service through the firewall:

firewall-cmd --permanent --add-service=ssh

Open other necessary ports:

Other necessary ports can be opened as needed. For example, if you want to run a web service, you need to open ports 80 and 443.

View current firewall rules:

firewall-cmd --list-all

Save firewall rules:

firewall-cmd --reload

2. Configure IP address

2.1 Configure static IP address

If the system needs to use a static IP address, you can edit the configuration file to configure it.

Edit file:/etc/sysconfig/network-scripts/ifcfg-eth0

Where eth0 is the name of the network card.

Modify the following content:

DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.1.100
NETMASK=255.255.255.0
GATEWAY=192.168.1.1

Restart network service:

systemctl restart network

2.2 Configure DHCP dynamic IP address

If the system needs to use DHCP dynamic IP address, modify the configuration file as follows:

Edit file:/etc/sysconfig/network-scripts/ifcfg-eth0

Modify the following content:

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

Restart network service:

systemctl restart network

3. Turn off Selinux

Selinux is a mandatory access control (MAC) system that improves system security. However, the configuration of Selinux may be complicated and may affect the normal operation of some applications. If you are unfamiliar with Selinux configuration, it is recommended to turn it off.

Edit file:/etc/selinux/config

Modify the following content:

SELINUX=disabled

Restart the system:

reboot

4. Other configuration

4.1 Set system time

You can use the ntpdate command to set the system time:

ntpdate ntp.aliyun.com

4.2 Install commonly used software

You can install some common software according to your needs, such as:

  • vim: text editor
  • wget:Download tool
  • unzip: decompression tool
  • tree: View directory tree

The above is the detailed content of After installing the Linux system, what basic configurations need to be done?. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:每日运维. If there is any infringement, please contact admin@php.cn delete
HP Battery Check – How to Download the Utility & Check HP Battery - MiniToolHP Battery Check – How to Download the Utility & Check HP Battery - MiniToolApr 25, 2025 am 12:53 AM

What is HP Battery Check? How to download HP Battery Check? How to check battery health on HP laptop in Windows 11/10? To find answers to these questions, go on reading and you can find much information given by php.cn.

Free Download Microsoft Excel 2019 on Windows/Mac/Android/iOSFree Download Microsoft Excel 2019 on Windows/Mac/Android/iOSApr 25, 2025 am 12:52 AM

Are you looking for a Microsoft Excel 2019 download source? You may want to download Excel 2019 for free on Windows/Mac/Android/iOS. php.cn Software writes this post to introduce some Microsoft Excel 2019 download sources for different platforms.

Powerful Solutions for Game Not Using GPU on PCPowerful Solutions for Game Not Using GPU on PCApr 25, 2025 am 12:51 AM

It is annoying to run into game not using GPU when playing a video game. How to fix it? If you find a game using 0 GPU, you can read through this post on php.cn Website to get help.

What's 192.168.10.1? Learn Essentials to Login, Change PasswordWhat's 192.168.10.1? Learn Essentials to Login, Change PasswordApr 25, 2025 am 12:50 AM

Do you know what “192.168.10.1” is? How to log in to your 192.168.0.1 IP address? php.cn will show you some basic information about this IP and some details on 192.168.10.1 admin login, change password & issue troubleshooting.

Resolved! Failed to Synchronize Achievements Error on Uplay - MiniToolResolved! Failed to Synchronize Achievements Error on Uplay - MiniToolApr 25, 2025 am 12:49 AM

The Failed to Synchronize Achievements error just not only happens on the Uplay client but also on Far Cry. When you launch the game, a message appears saying “Failed to Synchronize Achievements” which allows you to skip. If you want to get rid of th

How to Find the Process Start Time on Windows 10/11? - MiniToolHow to Find the Process Start Time on Windows 10/11? - MiniToolApr 25, 2025 am 12:48 AM

Many processes are running in the background when you use your computer. You may want to know the process start time. You can check a process start time using Windows PowerShell or Process Explorer. php.cn Software will introduce these two methods he

Microsoft Excel Price: Buy Microsoft Excel for PC/Mac - MiniToolMicrosoft Excel Price: Buy Microsoft Excel for PC/Mac - MiniToolApr 25, 2025 am 12:47 AM

To create and edit spreadsheets, most of you may use Microsoft Excel. Microsoft Excel is not free. Its stand-alone app costs $159.99. You can also buy a Microsoft 365 plan to get Excel and other Office apps. This post mainly explains the Microsoft Ex

How to Download, Install and Update Kyocera Drivers Windows 10/11 - MiniToolHow to Download, Install and Update Kyocera Drivers Windows 10/11 - MiniToolApr 25, 2025 am 12:46 AM

Do you use the printer in your work and life? Then, you must know before using it, you must download and install the corresponding driver. In this post on php.cn Website, we will mainly introduce to you how to install, update and download Kyocera pri

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)