Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What must be done after Centos7 installation

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail what must be done after Centos7 installation. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

1. Update the system and patch

Our Internet is very insecure. New loopholes appear and fixed every day, so we must update, update and update.

Yum-y update

The above command is to check for updates and install, including the kernel and software. It is recommended to update once as soon as the installation is completed, but it has already been put into production.

The system must be updated carefully.

2. Modify the default port of ssh remote login

If you open some common default ports, someone will scan and try to log in every day, leading to security problems and resource consumption.

Vi / etc/ssh/sshd_config

Find the # Port 23 Port which is preceded by # by default. After removing it, change 23 to an unconventional port, then save it.

Systemctl restart sshd

Restarting the ssh service takes effect.

PS: remember to change the port of your remote connection, otherwise you won't be able to connect.

3. Disable the default root account login, and create an ordinary account for login

Or edit the file above?

Vi / etc/ssh/sshd_config

Find the line # PermitRootLogin no, remove the previous #, change no to yes, and save it.

Then don't rush to restart the service, first create an account.

Useradd admin

Useradd is the create command, admin is the name of the account you want to create, and then set the password for the new account.

Passwd admin

After entering the above command, you will be asked to enter the password and confirm the password, and then you can try to log in remotely with the new account.

Systemctl restart sshd

After restarting the service, you will find that the root account cannot be logged in. After logging in with a normal account, enter su, and then enter the root password.

You can use the permissions of root.

4. Close SElinux

This is a security service, but the configuration is complex and will affect the deployment of a lot of software.

Vi / etc/selinux/config

Find # SELINUX=enforcing, change it to SELINUX=disabled, as shown above, and save it. This operation needs to be restarted

To take effect permanently, so it can be temporarily closed.

Setenforce 0

The command to see it in effect is

Sestatus

The display is turned off and the modification is successful!

About "what must be done after Centos7 installation" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report