30 Things to Do After Minimal RHEL/CentOS 7 Installation

17. Installing Webmin

Webmin is a Web based configuration tool for Linux. It acts as a central system to configure various system configuration like users, disk quota, services and configurations of HTTP server, Apache, MySQL, etc.

# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.740-1.noarch.rpm
# rpm -ivh webmin-*.rpm
Install Webmin on CentOS 7
Install Webmin

After webmin installation, you will get a message on terminal to login to your host (http://ip-address:10000) using your root password on port number 10000. If running a headless server you can forward the port and access it on a machine/server that is headed.

18. Enable Third Party Repositories

It is not a good idea to add untrusted repositories specially in production and it may be fatal. However just for example here we will be adding a few community approved trusted repositories to install third party tools and packages.

Add Extra Package for Enterprise Linux (EPEL) Repository.

# yum install epel-release

Add Community Enterprise Linux Repository.

# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
Install Epel Repo
Install Epel Repo

Attention! Extra care is needs to be taken while adding Third Party Repository.

19. Install 7-zip Utility

In the CentOS Minimal Install you don’t get utility like unzip or unrar. We have the option to install each utility as required or an utility that servers for all. 7-zip is such an utility which compress and extract files of all known types.

# yum install p7zip
Install 7zip Tool
Install 7zip Tool

Notice: The package is downloaded and installed from Fedora EPEL 7 Repository.

20. Install NTFS-3G Driver

A small yet very useful NTFS driver called NTFS-3G is available for most of the UNIX-like distribution. It is useful to mount and access Windows NTFS file system. Though other alternatives like Tuxera NTFS is available, NTFS-3G is most widely used.

# yum install ntfs-3g
Install NTFS-3G in CentOS
Install NTFS-3G to Mount Windows Partition

After installing ntfs-3g has been installed, you can mount Windows NTFS partitions (where /dev/sda5 is my windows drive) using following command.

# mount -ro ntfs-3g /dev/sda5 /mnt
# cd /mnt
# ls -l

21. Install Vsftpd FTP Server

VSFTPD which stands for Very Secure File Transfer Protocol Daemon is a FTP server for UNIX-like System. It is one of the most efficient and secure FTP Server available today.

# yum install vsftpd
Install Vsftpd in CentOS 7
Install Vsftpd FTP

Edit the configuration file located at ‘/etc/vsftpd/vsftpd.conf‘ to secure vsftpd.

# vi /etc/vsftpd/vsftpd.conf

Edit a few fields and leave other as it is, unless you know what you are doing.

anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES

You may also change the port number and open vsftpd port through the firewall.

# firewall-cmd --add-port=21/tcp
# firewall-cmd --reload

Next restart vsftpd and enable to start at boot time.

# systemctl restart vsftpd
# systemctl enable vsftpd

22. Install and Configure sudo

sudo which is commonly called as super do as well as suitable user do is a program for UNIX-like operating system to execute a program with the security privileged of another user. Let’s see how to configure sudo…

# visudo

It will open the file /etc/sudoers for editing..

sudoers File
sudoers File

Give all the permission (equal to root) to a user (say tecmint), that has already been created.

tecmint   ALL=(ALL)    ALL

Give all the permission (equal to root) to a user (say tecmint), except the permission to reboot and shutdown the server.

Again open the same file and edit it with the below contents.

cmnd_Alias nopermit = /sbin/shutdown, /sbin/reboot

Then add alias with Logical (!) operator.

tecmint   ALL=(ALL)    ALL,!nopermit

Give permission to a group (say debian) to run a few root privilege command say (add user and delete user) .

cmnd_Alias permit = /usr/sbin/useradd, /usr/sbin/userdel

And then add the permission to group debian.

debian ALL=(ALL) permit

23. Install and Enable SELinux

SELinux which stands for Security-Enhanced Linux is a security module at kernel level.

# yum install selinux-policy
Install SElinux in CentOS 7
Install SElinux Policy

Check SELinux Mode.

# getenforce
Check SELinux Mode
Check SELinux Mode

The output is enforcing mode which means SELinux policy is in effect.

For debugging, set selinux mode to permissive temporarily. No need to reboot.

# setenforce 0

After debugging set selinux to enforcing again without rebooting.

# setenforce 1

24. Install Rootkit Hunter

Rootkit Hunter abbreviated as Rkhunter is an application that scan rootkits and other potentially harmful exploits in Linux systems.

# yum install rkhunter
Install Rootkit Hunter
Install Rootkit Hunter

Run rkhunter as a scheduled job, from a script file or manually to scan harmful exploits in Linux.

# rkhunter --check
Scan for rootkits
Scan for rootkits
RootKit Scan Results
RootKit Scan Results

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

Avishek
A Passionate GNU/Linux Enthusiast and Software Developer with over a decade in the field of Linux and Open Source technologies.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

76 Comments

Leave a Reply
  1. I followed this guide. Its really helpful. As you said quite extensively about installing apache, databases and others.

    Can you also provide a guide regarding how to upload a site in CentOS after doing all this?

    Reply
  2. There is a mistake in the SSH section. The config file is NOT ‘ssh-config’. That is meant for the SSH client not the server. The SSH server settings are in ‘sshd-config’. As a noob, it took me a while to figure out why my changes had no effect on the server.

    Otherwise, this has been a great resource for someone like me learning Linux for the first time. Thanks!

    Reply
  3. One of the commands didn’t work for me, the one related to opening up the httpd port through firewalld. I got a syntax error

    I got a successful execution with the following command, because I did not choose to assign http a funky port, just the standard one (80)

    # firewall-cmd --permanent --zone=public --add-service=http 
    

    If you want to use a custom port for httpd, use this command, which specifies the port/protocol:

    # firewall-cmd --permanent --zone=public --add-port=2888/tcp 
    

    SOURCE:
    https://stackoverflow.com/questions/24729024/open-firewall-port-on-centos-7

    Reply
  4. Thank you for getting this information together, it is very helpful for people not familiar to minimal dekstop-less installations.

    Reply
  5. Hey, thanks for this list. It was very valuable for me to set up a new CentOS 7 configuration. So far I had only to deal with SLES. Thank you

    Reply
  6. The articel does only contain nonsense. Why somebody should protect grub when it can be by passed so easy?
    A speedtest cronjob? wtf?

    Reply
  7. When i change the Listen directive and restart the httpd following error occurs.

    Job for httpd.service failed. See ‘systemctl status httpd.service’ and ‘journalctl -xn’ for details.

    This happen when i tried to change Listen to 3221, 9090 or :9090 .. anything.
    While it works fine for port 80 and 8080

    Reply
    • Hi Atul. This could be caused by SELinux. Check if it is enabled by running “sestatus“. If it says enabled, you have to ways:

      1. Disable SELinux by running ‘setenforce 0‘;
      2. Add SE rules (using ‘semanage‘ command). In this case you will have SELinux enabled (which is recommended);

      Reply
  8. Hey, thank you for this list. It has been invaluable for me while setting up a new CentOS 7 configuration. I’m technical but this is easily understandable and readable for anyone.

    Reply
  9. Hi Guys,

    Cant open my website with elinks. It is saying that I need to enable my javascript. How to do that on centos7 minimal.
    Thanks

    Reply
  10. Use Secure Protocol over the default SSH Protocol and change port number also for extra Security. Edit the SSH configuration file ‘/etc/ssh/ssh_config‘.

    Reply
  11. Hi,
    The following
    # firewall-cmd -permanent -add-port=3221/tcp
    should be
    # firewall-cmd –permanent –add-port=3221/tcp

    Reply
  12. Hi, is anybody help me I am new to CentOS 7, regarding I am unable to enter into root mode.

    After reading point #22, I tried commands, but now i am unable to get into:

    1.sudo mode  
    2.unable to edit visudo
    3.unable to chmod 
    4.unable to chown
    5.unable to get into su-
    6.unable to get into su-
    

    why this happened it always says even i tried to attempt…

    sudo: >>> /etc/sudoers: syntax error near line 45 <<>> /etc/sudoers: syntax error near line 101 <<<
    sudo: parse error in /etc/sudoers near line 45

    sudo: no valid sudoers sources found, quitting
    sudo: unable to initialize policy plugin

    please help me i am new to cent os 7

    Reply
    • @Zack,

      Yes, you right, port should be opened to access from the public network over IP Address or Domain, for example:

      https://localhost:10000
      https://domain.com:10000
      
      Reply
  13. Hi, Nice post

    would you happen to have solution to install nginx in front of Apache to avoid opening httpd services by apache every time, and saving system resources.

    Cheers

    Reply
    • @Zack,

      You mean both nginx and apache should run on same server without any conflict? if yes, you should run nginx or apache on different ports..

      Reply
    • @Smallufo,

      Both links and elinks are commandline based web browsers and both are available to install from default repositories, no need to replace…

      Reply
    • @Vaishnavi,

      Thanks for finding this article useful, could you share the screenshot of the same? it will help us to understand more better about your problem..

      Reply
  14. thanks million for your good post,
    i find 2 small mistakes in spelling of commands that maybe because of them some users face problem in copy and paste the commands from the post.
    1. “permanent” spell in below section is not correct:
    Add service tomcat and default port (8080) through firewall and reload settings.
    # firewall-cmd —zone=public —add-port=8080/tcp —permannet

    2.reload in below command has just one dash(-):
    To add a service say http, temporarily and reload firewalld.
    # firewall-cmd –reload

    Reply
  15. I’m not sure who wrote this but it seems clear that he/she never attempted to follow her own instructions.
    The first step in setting up the network is to invoke

    yum install net-tools

    yum install requires a functioning network with accessible repositories if using the minimal CD.

    These instructions simply won’t ever work with a minimal installation CD.

    Reply
  16. For people unfamiliar with CLI text editors (vi, vim, nano), etc.
    You can configure static IP and hostname in a GUI environment, just type:

    # nmtui

    Once there, you can edit what you need.

    If ‘nmtui’ command not found, install it:

    yum install NetworkManager-tui

    Done!
    My 2 cents…

    Reply
    • @Chris,

      Thanks for the tip about configuring and setting hostname and IP address using GUI way, hope it will help Desktop Linux users, from me 10 cents to you…:) keep it up..

      Reply
  17. Thank You for collecting all that useful and not so useful in one article. :)
    Hmm, interesting, how many copypasters have used your sample passwords unchanged? :)
    Typos:
    # nmap 127.0.01
    # visudo

    Reply
  18. Thanks for the write up, I’m very new to this and it helps a bit. However, when I got to the firewall-cmd commands in step 6 I ran into some problems. Not sure if I did this correct or not but I had to run “yum install firewalld” then start it with “systemctl start firewalld”. Then I had to add a “-” before the arguments (replaced “firewall-cmd -add-service=http” with “firewall-cmd –add-service=http”.

    Reply
  19. as an experienced computer hobbyist, I was able to use this howto with minimal effort, only found some typo’s and all went well

    thank you for providing this information in such a well-written format

    Reply
  20. Hello

    my VPS only provide a centos standard version. How to change it to minimal version. What services will be remove?

    thank you before…

    Reply
  21. Hi,

    Your website was very helpful, thank you .

    In the Mariadb install section, think to change the following line :

    # firewall-cmd –add-service=mysql

    to

    # firewall-cmd –-add-service=mysql

    Regards

    Reply
      • It mustn’t be the best idea to add MySQL as public available service!

        For my point of view, the title of this article should be different, Noobies which install all this on their systems might end up with things, not ideally for everybody. Your site has built a huge reputation over time, and you just cannot recommend installing things like java or a compiler on a system, where it might not be explicitly needed!
        BUT: Positive to note: You explained mysql_secure_installation, firewalld, and selinux. There are still too may sites out there who forget, or disable this.

        Reply
  22. You have an mistake at Step 7:
    echo -e “” > /var/ww/html/phpinfo.php
    has to be
    echo -e “” > /var/www/html/phpinfo.php

    Reply
  23. lot of spelling errors in this article for the commands. nmap for example, “# namp 127.0.01” should be “# nmap 127.0.0.1”. the firewall command right after that part, “# firewall-cmd –list-ports” should be “# firewall-cmd –list-ports” (2 – , not 1).

    various other mistakes. the screenshots are good, just not the commands in code blocks.

    Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.