CentOS – Linux Hint https://linuxhint.com Exploring and Master Linux Ecosystem Fri, 12 Mar 2021 15:08:04 +0000 en-US hourly 1 https://wordpress.org/?v=5.6.2 Install Zimbra Collaboration Suite (ZCS) on CentOS 8 https://linuxhint.com/install-zimbra-collaboration-suite-zcs-on-centos-8/ Fri, 12 Mar 2021 13:06:35 +0000 https://linuxhint.com/?p=94163

Zimbra Collaboration Suite is open-source software that includes the Zimbra LDAP server, MTA (Mail Transfer Agent), and Zimbra mailbox server. It also provides you with a web-based administration panel that can be used to manage the domain and accounts. Zimbra collaboration software can run on various OS platforms including Red Hat, Ubuntu, CentOS, etc. In an earlier post, we have explained the installation of Zimbra Collaboration in Ubuntu. In today’s post, we will be going to explain how to install Zimbra Collaboration Suite on CentOS 8 system.

Prerequisites

For installing and running the Zimbra Collaboration server, you should have:

  • CentOS 8 system
  • Root privileges
  • A & MX record for your Server
  • Disk space 30 GB (at least)
  • RAM 8 GB (at least)
  • CPU/Processor 2.0 GHz (at least)

We have setup the CentOS 8 system with following specifications:

  • Zimbra Collaboration Suite: 8.8.15 GA Release
  • Domain: test.org
  • Server Hostname: mail.test.org
  • IP: 192.168.72.130

Steps to Install Zimbra Collaboration Suite on CentOS

Step 1: Install Dependencies

First, you will have to install some dependencies in your CentOS system. To do so, open the Terminal and execute the following command :

$ sudo yum install -y libidn gmp nptl nmap sysstat libaio libstdc++

Step 2: Disable Unwanted Services

You will need to disable unwanted services so that they do not conflict with the installation of the Zimbra collaboration suite. Here, we are going to disable SELinux, firewall, and postfix.

In order to disable SELinux, first execute the following command in Terminal to check if it is in “Enforcing” mode.

$ getenforce

If the output shows “Enforcing”, then change the SELinux mode to “Permissive”. Execute the following command to do so:

$ sudo setenforce 0

Now again run the following command to verify if the mode has been changed to “Permissive”:

$ getenforce

In order to disable the firewall, execute the following commands:

$ sudo systemctl stop firewalld
$ sudo systemctl disable firewall

To disable Postfix, run the following commands:

$ sudo systemctl stop postfix
$ sudo systemctl disable postfix

Step 3: Configure hostname and hosts file

Open the /etc/hostname file using the following command:

$ sudo nano /etc/hostname

Then in the file, add the FQDN as follows:

mail.test.org

Make sure to replace the mail.test.org with your FQDN. Now save and close /etc/hostname file.

Now open the /etc/hosts file as follows:

$ sudo nano /etc/hosts

Add the below entry in the file:

192.168.72.130 mail.test.org mail

Now save and close /etc/hosts file.

Step 4: Verify A and MX Records

Now verify the DNS configurations for your mail server. You can do this by using the below command in Terminal:

$ dig -t MX test.org

We can see from the output below that the MX and A records for our mail server have been configured properly.

Step 5: Install Zimbra Collaboration Suite

Now in this step, we will download and install the Zimbra collaboration suite.

1. To download the Zimbra collaboration suite, execute the following command in Terminal:

$ wget https://files.zimbra.com/downloads/8.8.15_GA/zcs-8.8.15_GA_3953.RHEL8_64.20200629025823.tgz

2. The downloaded Zimbra file will be in the .tgz archive format. To extract the archive file, use the following command:

$ tar -zxvf zcs-8.8.15_GA_3953.RHEL8_64.20200629025823.tgz

3. One the file is extracted; navigate to the extracted directory using the following command:

$ cd zcs-8.8.15_GA_3953.RHEL8_64.20200629025823/

4. In the extracted directory, you will see an installer file. To start the installation of Zimbra CS, run the installer as follows:

$ sudo ./install.sh

After executing the above command, the installation of Zimbra will be started.

Install zimbra collaboration

5. After performing a few checks, the installer will ask you to accept the conditions of the software License Agreement. Press “y” to accept the agreement.

6. Now, press “y” when asked to use Zimbra’s package repository.

7. Now, select the packages you want to install by pressing y. Press y for all the packages with the exception of the zimbra-imapd which is only available in the beta edition. After selecting the packages, the system will check the required space for installation. If it verifies the required space, it starts installing the selected packages; otherwise, it stops the installation.

8. When the following prompt appears, press y.

Now it will start installing the selected packages.

9. After the installation of packages is completed, the installer will check to see if the MX record is configured in DNS. At this stage, if an error appears as you can see in the following screenshot, then you will be asked to re-enter the domain name. First, type yes and press Enter and then type your domain name and again press Enter.

10. Now, the following view will appear showing you the default configurations. Here, you will also see some unconfigured option which is Admin Password marked with asterisks (******) to its left. To configure the Admin Password, press 7 from the Main menu.

11. Then from the Store configuration submenu, press 4 and then press Enter. Then type a password for the admin user (should at least contain 6 characters) and press Enter.

12. Now press “r” to return to the Main menu.

13. Now to apply the changes you have made, press a and then press Enter.

14. When asked to save the configurations to a file, type yes to save it and then press Enter.

15. After that, it will ask where you want to save the configurations. To save the configurations to the default (/opt/zimbra/config.75773]) location, just press Enter. If you want to save it on some other location, type the directory path and press Enter.

16. Then it will notify you that the system will be modified. Type yes and press Enter.

17. When the Configuration complete message appears, press Enter.

Now the installation of the Zimbra collaboration suite has been completed.

Step 6: Access Zimbra Administration Panel

Now access the Zimbra Administration panel using any web browser and typing the following URL:

https://mail.test.org:70701

When you open the above URL for the first time in your web browser, you will see a warning message that the connection is untrusted. You can simply ignore this message and continue. After that, a page will appear for you to type the username and password. Enter admin as a username and password that you have configured earlier during the installation.

Once you are logged in, you will see the following similar dashboard where you can view the summary.

Uninstall Zimbra Collaboration Suite

In case, you no longer need Zimbra on your system, you can easily uninstall it. Open the Terminal and go to the directory which contains the Zimbra installation files.

$ cd zcs-8.8.15_GA_3953.RHEL8_64.20200629025823/

Then execute the installer file with the -u option as follows to uninstall Zimbra from your system.

$ ./install.sh -u

Hit y, when it asks if you want to completely remove the existing installation. After which it, will completely uninstall Zimbra from your system.

Now, use the cd command to go back to the main directory which contains both the Zimbra collaboration archive and extracted directory:

$ cd

Then execute the following commands to remove both the archive and extracted directory:

$ sudo rm zcs-8.8.15_GA_3953.RHEL8_64.20200629025823.tgz
$ sudo rm –rf zcs-8.8.15_GA_3953.RHEL8_64.20200629025823

By following the above step by step procedure, you can easily install the Zimbra collaboration server on the CentOS system. We have also shown you how to uninstall Zimbra, in case you no longer want it in your system.

]]>
6 Ways to Find Your Private IP Address in CentOS 8 https://linuxhint.com/6-ways-to-find-your-private-ip-address-in-centos-8/ Fri, 12 Mar 2021 13:01:45 +0000 https://linuxhint.com/?p=94154

Introduction

Private IP addresses are used to communicate inside a local network. Private IP addresses cannot be routed and hence no traffic can be sent to them from the external network. There may come a time when you need to know the private IP address of your system like to setup a network-related application, to enable remote administration, or for troubleshooting, etc. In our previous posts, we have shared with you some ways to find the private IP address in Ubuntu and Debian OS.

In this post, we will describe some methods to find the private IP address in CentOS8. These methods involve both the command line and GUI based methods.

Following are the IP address ranges that are defined by IANA:

10.0.0.0/8=10.0.0.0 – 10.255.255.255
192.168.0.0/16=192.168.0.0 – 192.168.255.255
172.16.0.0/12=172.16.0.0 – 172.31.255.255

6 Ways to find private IP address in CentOS 8

Method # 1: The “ip” command

The most common way to find an IP address in CentOS is by using the “ip” command. Simply type ip followed by the addr” or “a” option:

$ ip a

or

$ ip addr

This command will display all the network interfaces along with their associated private IP addresses. The following output shows our private IP is 192.168.72.130/24.

Method # 2: The “ifconfig” command

The “ifconfig” command is also used to find the private IP address. To use this command, just type ifconfig in the terminal:

$ ifconfig

If running the above command gives you a “command not found” error, then you will have to first install the net-tools as follows:

$ sudo yum -y install net-tools

Once installed, you can then use it to find the private IP address.

This command will display all the network interfaces along with their associated private IP addresses. The following output shows our private IP is 192.168.72.130/24.

Method # 3: The “hostname” command

The “hostname” command is usually used to find the hostname of the system. However, using the hostname command with the -l option provides you with IP address information.

$ hostname -I

Following is the output of above command which shows our private IP is 192.168.72.130.

Method # 4: The “nmcli” command

The “nmcli” is a command-line utility for controlling NetworkManager. It can also be used to find the private IP address of your system.

$ nmcli

Here is the output of the nmcli command which shows the private address on our system is 192.168.72.130/24.

Method 5: Using ip route command

The “ip route” command is used to configure and display static routes in Linux OS. This command also shows the private IP address of a system. Issue the following command in Terminal to find your private IP address:

$ ip route

Here is the output of the nmcli command which shows the private address on our system is 192.168.72.130/24.

Method 6: Using GUI

This method is for all those users who prefer working on GUI instead of the command line. In order to find the private IP address via GUI, click the network icon in the top right corner of your desktop. This step is also highlighted in the following screenshot.

Then a menu will show up on your desktop. Click the Wired Connected option.

Then select Wired Settings.

The Settings window will appear in the Network view. Click the cog icon in front of the network interface also shown highlighted in the following screenshot.

Now the following window will open in the Details tab. Here you will find your private IP address in the Details tab which in our case is 192.168.72.130.

In this post, we have described several ways through which you can find the private IP address in CentOS 8. If you know of some other ways that we have missed for finding the private IP address in CentOS, please share with us in the comments!

]]>
How to Create and Delete Users on CentOS 8 https://linuxhint.com/how-to-create-and-delete-users-on-centos-8/ Sun, 07 Mar 2021 22:02:00 +0000 https://linuxhint.com/?p=93186

User management is much needed and must-know technique for a Linux server administrator. A Linux administrator often needs to create and grant different privileges and permissions to different users. This post will perform a couple of tasks like creating and deleting the user on the CentOS 8 Operating system.

As you know, the creation and deletion of a user is an administrative type of task, and for performing such tasks, you must log in as a root user or execute all the commands with the sudo privileges. Let’s start and see how to add or create a user in the CentOS 8 system.

Creating a user in CentOS 8

The user can be added or created in the CentOS 8 system using the “adduser” command in the terminal. For example, if we want to create a user with the name “John”, the command would be like this:

$ sudo adduser john


After successfully creating the user, it’s time to assign the password to the newly created user. You can simply assign the password using the “passwd” command:

$ sudo passwd john

After running the above command, it will prompt for the password, so provide the password twice, and the password will be set for the newly created user.

Granting Sudo privileges to the User

Suppose you want to give administrative rights to this newly created user. In that case, you have to add the user in the wheel group (the group which grants sudo privileges to all of its users automatically). To add the user to the wheel group, type the command given below:

$ sudo usermod -aG wheel john

The administrative rights are granted successfully to the newly created user as well. Now let’s see how to delete a user in the CentOS 8 Operating system.

Deletion of a user in CentOS 8

Now, if you want to delete any user from the CentOS 8 Operating system due to any reason, either that user is unnecessary or not needed anymore. For example, if we want to delete the user “john”, we can delete such a user using the “userdel” command:

$ sudo userdel -r john

The “-r” flag in the above-given command is for deleting the user’s home directory. If you do not want to delete the user’s home directory, you can run the above command without the “-r” flag.

This is it; the user is deleted successfully as well from the CentOS 8 Operating system.

Conclusion

This post explains user creation, granting privileges to the user, and deleting a user from the CentOS 8 Operating system. Users with different privileges have a lot to do while managing the Linux servers, and after reading this post, you can manage the users well on CentOS 8 Operating system.

]]>
How to Install Apache Cassandra on CentOS 8 https://linuxhint.com/install-apache-cassandra-centos-8/ Sun, 07 Mar 2021 21:32:18 +0000 https://linuxhint.com/?p=93229

Apache Cassandra is a very popular NoSQL database created by Facebook Inc. but later owned by Apache Foundation. It was designed and built for the ease of scalability and management of large databases. Apache Cassandra is a must-go database Management System for you if your concern is high availability and scalability. This post will take you to a step-by-step guide on installing and configuring Apache Cassandra on CentOS 8 Operating system.

Installation of Apache Cassandra on CentOS 8

Apache Cassandra can be installed by downloading the RPM package through the official repository of Apache Cassandra.

But, before getting started with the installation and configuration of Apache Cassandra on CentOS 8, we need to have OpenJDK 8 installed on the CentOS 8 system.  You can verify the installed version of Java, either it is installed or not on your system, by typing the command given below:

$ java -version

If it is not installed on your system, you can install it using the procedure given below or pre-installed on your system; you can skip the installation part of OpenJDK on CentOS 8.

Install Open JDK on CentOS 8

OpenJDK is available in CentOS 8’s official repository and can easily be installed.

First of all, update the system’s package repository cache:

$ sudo dnf makecache

After updating your CentOS 8’s system repository cache, update it:

$ sudo dnf upgrade


After upgrading the system’s existing packages, you can move forward to installing OpenJDK 8 on CentOS 8 for Apache Cassandra. To install OpenJDK from CentOS 8 official repository, type the command given below in the terminal:

$ sudo dnf install java-1.8.0-openjdk-devel


Type “y” and hit “Enter”.


After installing OpenJDK, verify by typing the command given below:

$ java -version


You can witness that the installed version of OpenJDK is 1.8.0. Let’s move ahead.

Install Apache Cassandra

To install Apache Cassandra, we have to add the repository of Apache Cassandra to the system.

To add Apache Cassandra repository to the CentOS 8 system. Create a “/etc/yum.repos.d/cassandra.repo” file by typing the command:

$ sudo nano /etc/yum.repos.d/cassandra.repo

In the newly created Cassandra repository file, paste the content given below in that file.

[cassandra]
name=Apache Cassandra
baseurl=https://www.apache.org/dist/cassandra/redhat/311x/
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://www.apache.org/dist/cassandra/KEYS


After adding the above content, save the file and exit using the keyboard shortcut keys (CTRL+S) and (CTRL+X).

Now, install the Apache Cassandra by typing the command given below:

$ sudo dnf install cassandra -y

Apache Cassandra is installed on CentOS 8. Now, Apache Cassandra’s service won’t automatically start. You first have to enable it by typing the command given below:

$ sudo systemctl enable cassandra

Then, start the service by typing the following command:

$ sudo systemctl start cassandra

Now, in order to verify, check the status of the Apache Cassandra service by typing the command given below:

$ sudo systemctl status cassandra

At this stage, Apache Cassandra is successfully installed and running perfectly fine on the CentOS 8 machine. Let’s configure it and log in to its CQL shell.

How to configure Apache Cassandra on CentOS 8

Apache Cassandra has its own CQL (Cassandra Query Language), just like SQL. To login to Cassandra’s command-line utility, known as CQL shell or “cqlsh”, we have to install an appropriate python interpreter first. To install Python 2 and access the CQL shell on CentOS 8, type the command given below:

$ sudo dnf install python2

Type “y” and press “Enter”.

Once Python2 is installed, log in to the CQL shell using the command line utility of Cassandra by typing the following command in CentOS 8 terminal:

$ cqlsh

You can witness in the screenshot; we have successfully logged in to the CQL shell.

This is how simply we can configure the Apache Cassandra on CentOS 8 and start using it.

Conclusion

Apache Cassandra Database is used by many big names in the industry like Facebook, Instagram, Netflix, and Reddit. This post contains a clear understanding and profound guide on how to install and configure Apache Cassandra on CentOS 8.

]]>
How to Install Slack on CentOS 8 https://linuxhint.com/install-slack-centos-8/ Sun, 07 Mar 2021 21:03:16 +0000 https://linuxhint.com/?p=93276

Slack is a very popular application used for communicating and collaborating with the team members of a company or an organization. Slack provides various workspaces for teammates to connect with each other at a single platform known as a channel. You can have an individual or group discussion in a channel, share files and images, and have a video or audio call for quick collaboration with your teammates and make quick decisions.

Slack is a cross-platform collaborative application, and it can be installed on all major Operating systems like Windows, macOS, and Linux Operating systems. We will learn the installation of Slack on the CentOS 8 system in this post. Let’s get started.

Installation of Slack on CentOS 8

Installing the Slack application on CentOS 8 is as easy as installing any other application. We will learn to install the Slack application on CentOS 8 by using the .RPM file.

Install Slack using the RPM file on CentOS 8

First of all, and as always, update your system’s metadata cache:

$ sudo dnf makecache

And update the system’s DNF package repository as well:

$ sudo dnf upgrade

<

To install Slack on CentOS 8, we need to download Slack’s RPM file for CentOS 8 by visiting Slack’s official website. Visit the link given below:

https://slack.com/intl/en-pk/downloads/linux

Click on the “DOWNLOAD .RPM (64-BIT)” button.


Save the file, and Slack starts to download.

Once the RPM file is downloaded, open the directory in which the RPM file of the Slack application is downloaded.

Open the directory in the terminal by right-clicking in the directory and selecting the “Open in terminal” option.


A terminal window will open like this.


Now, type the following command in the terminal and make sure you are in the Downloads directory or the directory in which the RPM file of Slack is downloaded:

$ sudo dnf localinstall ./slack-*.rpm

Type “y” and hit “Enter”.

At this moment, Slack is installed on your CentOS 8 system.

Launch the Slack Application

After successfully installing Slack on CentOS 8, you can launch the slack on CentOS by searching for “Slack” in the activities and clicking on the Slack icon from the search results.

Here you can see the login screen of Slack on your CentOS 8 machine. Sign In to Slack and get started.

This is how you can install slack on your CentOS 8 machine.

How to update Slack on CentOS 8

Slack can easily be updated if you find its new version is released by typing the command given below.

$ sudo dnf update slack

How to uninstall Slack from CentOS 8

If you want to uninstall or remove Slack from your CentOS 8 system due to any reason, You can do so by typing the command given below in the terminal of CentOS 8.

$ sudo dnf remove slack

Type “y” to continue the uninstallation process of Slack.

Slack will be successfully removed or uninstalled from your CentOS 8 machine.

Conclusion

Slack is rapidly growing, and many big organizations and companies are using it to collaborate and have quick decisions. In this post, we have provided you an easy-to-understand guide on installing Slack on CentOS 8 by merely downloading the RPM file of the Slack application for Red Hat enterprise Operating systems and installing it by running one simple command. If you want to learn more about Slack, feel free to visit the official Help Center of Slack on their official website.

]]>
How to Install WireGuard VPN on CentOS 8 https://linuxhint.com/install-wireguard-vpn-centos/ Fri, 26 Feb 2021 17:42:39 +0000 https://linuxhint.com/?p=91509

WireGuard is a popular point-to-point open-source communication protocol that is used to create a secure and fast Virtual Private Network tunnel. This VPN was designed for use in the Linux Kernel. WireGuard is a lightweight VPN that provides extremely fast speeds to users.

This article shows you how to install and set up WireGuard on your CentOS 8 system. The installation and setup of WireGuard are much easier than the already-existing VPNs, like OpenVPN, and this is a major reason behind its growing popularity in the Linux community.

Overview

This article is comprised of two sections:

  • In the first section, we will install and configure a CentOS 8 machine that will act as a WireGuard VPN Server.
  • In the second section, we will install and configure a CentOS 8 machine that will act as a WireGuard VPN Client.

Installing and Configuring WireGuard on a CentOS 8 Server

In this section, we will set up a CentOS 8 machine that will act as a server by installing WireGuard.

Step 1: Add EPEL and Elrepo Repositories

To get started with installing WireGuard on CentOS 8, first, add the EPEL and Elrepo repositories to install the kernel modules and WireGuard tools.

$ sudo dnf install epel-release elrepo-release -y

Now, after installing the required repositories, install the kernel modules and WireGuard tools.

Step 2: Install Kernel Modules and WireGuard Tools

The kernel modules and WireGuard tools can be installed quickly from the EPEL and Elrepo repositories by issuing the following command:

$ sudo dnf install kmod-wireguard wireguard-tools

When you are prompted for permission to import and add the GPG keys to the CentOS 8 system, allow this action by typing “Y” and hitting “Enter.”

After successfully installing the WireGuard tools, we will now perform some configurations.

Step 3: Create Public and Private Keys

First, we will create a new ‘/etc/wireguard’ directory so that we can configure the VPN server in the directory. To create a new ‘/etc/wireguard’ directory in the CentOS 8 system, issue the following command.

sudo mkdir /etc/wireguard

After creating the directory, create the public and private keys using the “wg” and “tee” command-line tools. The command for creating private and public keys is as follows.

$ wg genkey | sudo tee /etc/wireguard/privatekey | wg pubkey | sudo tee /etc/wireguard/publickey

The generated key will be printed upon execution of the above command.

Step 4: Configuration of Tunnel Device for Routing VPN Traffic

To set up a device, create a configuration file in the ‘/etc/wireguard’ directory and open the file using the nano editor.

Before creating the configuration file, obtain the Private Key using the following command.

$ sudo cat /etc/wireguard/privatekey

Save the private key somewhere; you will need this key later in the configuration file.

Now, create the “wg0.conf” file.

$ sudo nano /etc/wireguard/wg0.conf

Add the content given below to the “/etc/wireguard/wg0.conf” file.

[Interface]

## IP Address of VPN server ##
Address = 192.168.18.200/24

## Save the configuration when a new client will add ##
SaveConfig = true

## port number of VPN server ##
ListenPort = 51820

## Private Key of VPN Server ##
PrivateKey = SERVER_PRIVATE_KEY

## Command to be executed before starting the interface ##
PostUp     = firewall-cmd --zone=public --add-port 51820/udp && firewall-cmd --zone=public --add-masquerade

## Command to be executed before turning off the interface ##
PostDown   = firewall-cmd --remove-port 51820/udp --zone=public && firewall-cmd --remove-masquerade --zone=public

This configuration file contains the following key terms:

  • Address – the private IP address for the Interface (wg0).
  • SaveConfig = true – saves the state of the interface on restart or shutdown of the server.
  • ListenPort – the port where the WireGuard daemon listens.
  • PrivateKey – the key that we have just generated.
  • PostUp – this command will be executed before firing up the interface
  • PostDown – this command will be executed before turning off the interface.

Now that you understand the Configuration file pretty well, you can save the file and exit using the keyboard shortcuts (CTRL + S) and (CTRL + X).

Step 5: Set Privileges of Configuration and “privatekey” File

Now, we will make the VPN server a bit more secure. A basic user should not have the privileges to read the configuration file and the ‘privatekey’ file. To provide access to these files, we will change the mode of these two files to 600. The command for setting the permissions is given below.

$ sudo chmod 600 /etc/wireguard/privatekey

$ sudo chmod 600 /etc/wireguard/wg0.conf

After finalizing the permissions, we will fire up the interface (wg0) using the wg-quick command-line tool.

Step 6: Start the Interface

To fire up the interface, issue the command given below:

$ sudo wg-quick up wg0

If you have obtained the output shown in the screenshot above, you have successfully started the interface. We will now check the status of the interface.

$ sudo wg

Enable the interface to auto-start the interface on boot of the CentOS 8 server.

$ sudo systemctl enable wg-quick@wg0

At this stage, the server setup has been completed. Now, if you want to set up this VPN server for NAT, you will need to enable IPv4 forwarding.

Step 7: Enable IPv4 Forwarding

To enable IPv4 forwarding for the NAT, create a “99-custom.conf” file in the “/etc/sysctl.d” directory using the nano editor.

$ sudo nano /etc/sysctl.d/99-custom.conf

Add the following content to the “/etc/sysctl.d/99-custom.conf”

## for enabling IPv4 forwarding ##
net.ipv4.ip_forward = 1

To enable IPv6 forwarding, add the following content to the “/etc/sysctl.d/99-custom.conf” file, as well.

## for enabling IPv6 forwarding ##
net.ipv6.conf.all.forwarding = 1

After enabling IPv4 forwarding, save the file and exit using the shortcuts (CTRL +S) and (CTRL + X).

Let us now move on to set up the WireGuard Client machine.

Installation and Configuration of WireGuard VPN on CentOS 8 Client

In this section, we will set up a CentOS 8 machine that will act as a client. The process of installing and configuring the WireGuard VPN client will be nearly the same as it was for the WireGuard VPN server.

Step 1: Add EPEL and Elrepo Repositories

First, we will add the EPEL and Elrepo repositories to install the kernel modules and WireGuard tools:

$ sudo dnf install epel-release elrepo-release -y

Now, after installing the required repositories, we will install the kernel modules and WireGuard Tools.

Step 2: Install Kernel modules and WireGuard Tools

The kernel modules and WireGuard tools can now be installed from the EPEL and Elrepo repositories by issuing the following command.

$ sudo dnf install kmod-wireguard wireguard-tools

When you are asked for permission to import and add the GPG keys to the CentOS 8 system, allow the changes by typing “Y” and hitting “Enter.”

After the WireGuard tools have been successfully installed, the CentOS 8 Client machine needs to be configured, as well.

Step 3: Create Public and Private Keys

In this step, we will create a new ‘/etc/wireguard’ directory in the Client machine. To create the new ‘/etc/wireguard’ directory in your CentOS 8 system, enter the following command.

sudo mkdir /etc/wireguard

After creating the directory, create the public and private keys using the “wg” and “tee” command-line tools. The command for creating private and public keys is provided below.

$ wg genkey | sudo tee /etc/wireguard/privatekey | wg pubkey | sudo tee /etc/wireguard/publickey

The generated keys will now be printed.

Step 4: Configuration for Routing VPN Traffic

In this step, we will create a configuration file in the ‘/etc/wireguard’ directory and open it using the nano editor.

Before creating the configuration file, get the Private key using the following command.

$ sudo cat /etc/wireguard/privatekey

Save the private key somewhere; you will need it later in the configuration file.

Now, create the “wg0.conf” file.

$ sudo nano /etc/wireguard/wg0.conf

Add the content given below to the “/etc/wireguard/wg0.conf” file

[Interface]
## Private Key of VPN Client ##
PrivateKey = 8D8puLQCbUw+51wPE3Q7KutGxQhUvsy+a+DBgamb+3o=

## IP address of VPN Client ##
Address = 192.168.18.201/24

[Peer]
## Public Key of CentOS 8 VPN Server ##
PublicKey = VWndJ4oB7ZJwC/7UOm++OLDrbAxMPsR2yd0cl3sEkUI=

## set ACL ##
AllowedIPs = 0.0.0.0/0

## IP address and Port of CentOS 8 VPN Server ##
Endpoint = 192.168.18.200:51820

The configuration file contains the following key terms:

  • PrivateKey – the key generated on the client machine.
  • Address – the IP address for the Interface (wg0).
  • PublicKey – the public key of the VPN server machine to which we want to connect.
  • AllowedIPs – all allowed IP addresses for traffic flow using the VPN.
  • Endpoint – we will provide the IP address and port number of the CentOS 8 server machine to which we want to connect.

We have now configured the client machine, as well. Save the file and exit using the keyboard shortcuts (CTRL + S) and (CTRL + X).

Step 5: Set Privileges of Configuration and “privatekey” File

Now, we will change the mode and set the privileges of the configuration file and “privatekey” file to 600. Enter the following command to set the permissions.

$ sudo chmod 600 /etc/wireguard/privatekey

$ sudo chmod 600 /etc/wireguard/wg0.conf

Now that we have finalized the permissions, we can fire up the interface (wg0) using the “wg-quick” command-line tool.

Step 6: Start the Interface

To fire up the interface, issue the command given below:

$ sudo wg-quick up wg0

We have now successfully started the interface. Next, we will check the status of the interface.

$ sudo wg

Enable the interface to auto-start the interface on boot of the CentOS 8 server.

$ sudo systemctl enable wg-quick@wg0

At this stage, the client is also set up.

Step 7: Add IP Address and Public Key of Client to CentOS 8 Server

The final step is to add the IP address and public key of the VPN client machine to the configuration file of the CentOS 8 WireGuard VPN server machine.

Return to the server machine and add the following content to the “/etc/wireguard/wg0.conf” file.

[Peer]
## Public Key of VPN Client ##
PublicKey = dmfO9pirB315slXOgxXtmrBwAqPy07C57EvPks1IKzA=

## IP Address of VPN Client ##
AllowedIPs = 192.168.10.2/32

After updating the configuration file of the VPN server, save the file and exit using the keyboard shortcuts (CTRL + S) and (CTRL + X).

The tunnel has now been established, and all the traffic will be passed through the CentOS 8 WireGuard VPN server.

Step 8: Verify Tunnel Connection

To verify that the CentOS 8 WireGuard VPN server has been installed and configured properly, issue the command given below to verify that traffic is flowing through the configured WireGuard VPN Server.

$ sudo wg

And that is it! You have configured and established the WireGuard VPN server successfully.

Conclusion

This article showed you how to install and configure WireGuard VPN on your CentOS 8 machine and set the system up as a VPN server. We also showed you how to set up a CentOS 8 WireGuard VPN Client and configure the client to route the traffic through the WireGuard VPN server.

]]>
How to Install Webmin on CentOS 8 https://linuxhint.com/install-webmin-centos/ Thu, 25 Feb 2021 06:57:56 +0000 https://linuxhint.com/?p=91490
Webmin is a popular open-source web-based control panel that is used for configuring and managing Unix-like operating systems. This tool allows you to manage your Linux server, and you can use the web interface for managing and creating files, directories, users, and groups. Webmin also allows users to manage services such as FTP, mail, and web servers. This article covers the installation procedure of Webmin on CentOS 8.

Installation of Webmin on CentOS 8

The process of installing Webmin on CentOS 8 is quite straightforward. You can install Webmin on CentOS 8 machine using the RPM package in only four simple steps.

Step 1: Update CentOS8 System

First, update the DNF package repository cache and make sure that the system is up-to-date. To update the DNF repository cache, issue the following command.

$ sudo dnf makecache

To upgrade the system, enter the command given below.

$ sudo dnf upgrade

Now, after updating the DNF repository cache and installed packages, we will download the Webmin RPM package and then install it using the dnf package manager.

Step 2: Download Webmin RPM Package

To download the RPM package of Webmin, you can either:

Download the RPM file from the official website of Webmin by visiting the link below:
https://www.webmin.com/download.html

Or, download the RPM package of Webmin by issuing the following command in the CentOS 8 terminal.

$ wget http://prdownloads.sourceforge.net/webadmin/webmin-1.970-1.noarch.rpm

After downloading the Webmin RPM package, download and install the optional dependencies by entering the command given below.

$ sudo dnf install perl perl-Net-SSLeay openssl perl-Encode-Detect

Once the optional dependencies of Webmin have been installed, we will install the downloaded RPM package of Webmin.

Step 3: Install Webmin Using the RPM package

To install Webmin using the downloaded RPM file, issue the following command.

$ sudo rpm -Uvh webmin-1.970-1.noarch.rpm

Now, the latest stable version of Webmin has been installed.

You can start using the Webmin Control panel by going to a browser and visiting the localhost with the port 10000 since the default port of Webmin is 10000.

https://localhost:10000

To connect to the Webmin remotely, you will need to configure the Firewall settings for Webmin.

Step 4: Configuring Firewall Settings for Webmin

Since Webmin listens on port 10000 by default, we will need to add port 10000 to the firewall. To allow port 10000, enter the following command:

$ sudo firewall-cmd --add-port=10000/tcp --zone=public --permanent

Once the firewall has been configured, you should now be able to access the web interface remotely.

Step 5: Start Using Webmin

To access Webmin from any other system, you can access it by typing the server IP address, along with the port number 10000, in any browser of your choice.

Conclusion

This article showed you how to install Webmin on CentOS 8. We also showed you how to configure the CentOS 8 system firewall to access the Webmin portal remotely. From the Webmin portal, you can manage and configure the Linux server according to your needs and preferences.

]]>
How to Install and Use Curl in Centos 8 https://linuxhint.com/install-use-curl-centos/ Thu, 25 Feb 2021 06:56:14 +0000 https://linuxhint.com/?p=91513
Curl, short for “Client URL,” is a popular command-line utility that is used to transfer data between a server and its client using various protocols, such as HTTP, HTTPS, FTP, SMTP, etc. Curl provides data security and the effortless simultaneous transfer of multiple files. This article covers the installation and usage processes of Curl on the CentOS 8 operating system.

Installation of curl on CentOS 8

The Curl package is available in the official package repository of CentOS 8, and it can easily be installed.

First, ensure that your CetnOS 8 system is up-to-date by issuing the following command:

$ sudo dnf makecache

Next, update your system by entering the command given below:

$ sudo dnf upgrade

After updating your system, install Curl from the standard package repository of CentOS 8 by entering the following command:

$ sudo dnf install curl -y

The “-y” flag will proceed with the installation. When a prompt appears, press “y” to continue the installation process.

After installing curl, issue the following command to verify the installation of Curl:

$ curl

If you obtain an output like that shown in the screenshot above, you have installed Curl successfully, and the program is running perfectly fine. We will now show you how to use Curl on your system.

How to Use Curl on CentOS 8

Let us begin using Curl with a simple URL. If you want to view the source code of any website, simply paste the URL of that website in the terminal, followed by the Curl command. For example, the command for viewing the source code of the LinuxHint website would be as follows:

$ curl https://linuxhint.com

The entire source code of the LinuxHint website will print in the terminal.

Another implementation of the Curl command is to download a file from any URL. For example, to download a file called “index.html” from the URL “www.example.com” using the Curl command, the command would be as follows:

$ curl -O http://www.example.com/index.html

After executing the above command, the “index.html” file will start to download.

Conclusion

This article showed you how to install Curl on CentOS 8 and start using it. This post contains the installation process of Curl, as well as its usage, such as getting the source code of a website and downloading a file from a website. The functionality of the Curl command does not stop here, and it provides a lot of other features to users. You can read the manual page on the official Curl website to learn more.

]]>
How to Install TeamViewer on CentOS 8 https://linuxhint.com/install-teamviewer-centos/ Thu, 25 Feb 2021 00:16:17 +0000 https://linuxhint.com/?p=91449
TeamViewer is a popular multi-platform application that is used for remotely accessing and controlling other desktop systems. TeamViewer is also used for file sharing between two systems. This application is not available in the CentOS 8 package repositories, but it provides the RPM package for installing TeamViewer on RedHat-based operating systems. This article provides a step-by-step guide on installing TeamViewer on CentOS 8 using the RPM file.

Installation of TeamViewer on CentOS 8

Installing TeamViewer on CentOS is pretty simple. Just follow the steps given below to install TeamViewer on your system.

Step 1: Download TeamViewer RPM File

You can download the TeamViewer RPM file from its official website by visiting the following link:

https://www.teamviewer.com/en-us/download/linux/

Click ‘x86-64bit’ to download the 64-bit RPM package for CentOS 8, or select ‘x86_32bit’ on the base of your operating system.

Save the RPM file and press “OK” in the prompt box.

The Teamviewer RPM package will be downloaded in the Downloads folder.

Step 2: Enable EPEL Repository

Fire up your terminal and navigate to the Downloads directory.

$ cd Downloads

Now, before starting the installation process of TeamViewer, we need to enable an EPEL repository on our CentOS 8 machine. First, issue the following command to enable the EPEL repository.

$ sudo dnf install epel-release

Next, update the system’s DNF repository cache.

$ sudo dnf makecache

Step 3: Install TeamViewer Using RPM File

After enabling the EPEL repository, make sure that you are in the Downloads directory. In the Downloads directory, issue the command given below to start the installation process of Teamviewer.

$ sudo dnf install ./teamviewer_15.15.2.x86_64.rpm

Type “y” to give the system permission to take up the required disk space and continue the installation.

The TeamViewer application has now been installed on CentOS 8. After successfully installing the TeamViewer application on CentOS 8, you can launch the TeamViewer application

Step 4: Start TeamViewer Application

To launch the TeamViewer application, go to Activities and search for “TeamViewer.”

From the search results, select the TeamViewer icon by clicking on it to start the TeamViewer application.

Before starting the TeamViewer application, you will be prompted to accept the License Agreement. Accept the License Agreement and proceed to use TeamViewer.

TeamViewer has now successfully started. But, you can see that the application is giving a warning that “Wayland detected” and incoming remote control connections will fail. In the next step, we will fix this warning.

Step 5: Configuring TeamViewer for Incoming Remote Control Connections

Though connecting to other computer systems is possible using TeamViewer, the incoming remote control connections will not be able to access this CentOS machine until you log out from the Wayland session and log in with the X11 display server. To resolve the Wayland detection warning, first, log out from the Wayland session.

Next, click the “Log Out” option,

And, click the “Log Out” button in the prompt, as well.

Then, click the “Settings” icon, as shown in the picture above.

In this menu, you will see options for selecting different display servers. Select the “Standard (X11 display server) on Xorg” option for the modern desktop environment.

After selecting the display server, log in with your CentOS 8 user credentials, and relaunch the TeamViewer application.

Here, you can see that we have successfully configured the TeamViewer application for remote control connections. Now, we can remotely access the designated CentOS 8 machine.

Conclusion

In this post, you learned how to install the latest version of the TeamViewer application on CentOS 8 by downloading the RPM file from its official website. We also showed you how to configure TeamViewer for incoming remote control connections on CentOS 8 by changing the display server from Wayland to X11.

]]>
How to Install and Use FFmpeg in CentOS 8? https://linuxhint.com/install-use-ffmpeg-in-centos8/ Tue, 24 Nov 2020 17:38:19 +0000 https://linuxhint.com/?p=78092 If you’d like a fast way of converting between audio and video files in Linux and would like something that doesn’t chew on resources and does the task properly, then you may give FFmpeg a try. FFmpeg is vital for keeping some level of familiarity between files uploaded by multiple users, as well as help maintain your storage space under control. When using FFmpeg, you can translate, adjust sample rates, record audio/video streams, and resize files between different video and audio formats. It provides a collection of audio and video libraries that are shared, including libavcodec, libavformat, and libavutil. Whenever it refers to converting files, FFmpeg has several command-line choices, and it is also recommended to use it from the CLI. Follow me on, and I’ll lead you to install FFmpeg in Centos 8.

FFmpeg is not offered in the default repositories of Centos 8. You may opt to build FFmpeg utilities from the source or install them from the Negativo17 directory via DNF. In this article, we’ll move ahead with the second choice. It is also the fastest way to implement FFmpeg on the Centos 8 OS.

The installation process for FFmpeg in Centos 8 is as follows:

Install Epel Repository

There are two directories that we will depend on to install FFmpeg on Centos 8. The first is an EPEL directory containing a lot of extra packages that are not delivered with the Centos 8 base media installation.

First of all, you will have to check whether your Centos 8 has an epel repository installed and enabled or not. For this purpose, execute the following command:

$ sudo yum repolist

You can see that no Epel repository is installed in the system, as shown in the image below.

In Centos 8, you could install the EPEL directory via YUM or DNF, whatever you are more confident with. You have to implement the cited commands below to install the Centos 8 epel repository.

$ sudo yum install epel-release

Or

$ sudo yum –y install epel-release

Or

$ dnf install https://dl.fedoraproject.org/pub/epel/
epel-release-latest-8.noarch.rpm

After that, you will be asked to confirm your action by typing “y”, and then hit Enter to continue installation. As a result, the epel repository will be installed in your system.

You will see that the Epel repository is now installed on the system using the Repolist command.

$sudo yum repolist

Install RPM Fusion Repository

To deliver tools not delivered by Fedora and Red Hat-based distributions, the RPM Fusion directory was developed. In this directory, all software programs available are supported as precompiled RPM files. Fusion provides two libraries, one open, which we’ll be using, and one non-free. Both are available for free download, but the non-free directory contains software that may not be protected by open source licenses.

You may install the RPM Fusion repository by using any of the corresponding YUM commands:

$ yum install https://download1.rpmfusion.org/free/el/
rpmfusion-free-release-8.noarch.rpm

$ https://download1.rpmfusion.org/nonfree/el/
rpmfusion-nonfree-release-8.noarch.rpm

If you choose DNF, you may use any of the corresponding commands:

$ https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm
$ https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm

After that, you will be asked to confirm your action. Type “y” and then tap Enter to continue as displayed. You can see that the RPM Fusion repository will be installed in your system. Remember to use YUM or DNF only.

Using the repolist command, you can see that the RPM Fusion repository is now installed in the system.

$ yum repolist

Enable Power Tools

The last part is to activate the power tools in Centos 8 before FFmpeg is installed. For this task, use the following command:

$ sudo dnf config-manager –enable PowerTools

Install FFmpeg

And, here’s what you might be looking for! After EPEL and RPM, fusion libraries have been added. We can finally install FFmpeg! Execute the following instructions on your terminal to install FFmpeg and all its components on your Centos 8/RHEL 8 Linux framework.

You may install the FFmpeg and its dependencies by using the corresponding DNF commands:

$ sudo dnf install ffmpeg
$ sudo dnf install ffmpeg ffmpeg-devel

You may also install the FFmpeg and its dependencies using the corresponding YUM commands:

$ sudo yum install ffmpeg
$ sudo yum install ffmpeg ffmpeg-devel

You will be asked more than one time to confirm your action. Type “y” and then tap Enter to continue as shown. You can see that the FFmpeg tool will be installed in your system.

Verify Installation

Now, you are allowed to see the installed version. Follow one of the two instructions, and on successful installation, you will see a comparable result.

$ rpm -qi ffmpeg
$ ffmpeg -version

The latest version of FFmpeg installed in the Negativo17 repository is 4.2.4.

For certain command-line solutions, you can even get assistance from:

$ ffmpeg --help

Basic Conversion:

We’ll look at some simple examples in this part to use the FFmpeg feature. The good thing about this is, you may not have to define the input and output types when translating audio and video files while using it. It automatically detects the input file format and guesses the output format from its file extension.

Use the cited command below for the conversion of a video file having extension mp4 to webm:

$ ffmpeg –i input.mp4 output.webm

You can write the name of the input file that you want to convert at the place of ‘input.mp4’ also you can rename your output file name with “output.webm”.

Use the following command for converting file having extension from mp3 to ogg:

$ ffmpeg –i input.mp3 output.ogg

You can write the name of the input file that you want to convert at the place of ‘input.mp3’, also you can rename your output file name with “output.ogg”.

Using codecs

Just use the -c option to define codecs while transferring files. It may be an authorized decoder/encoder name or a replica of vital importance that merely clones the input.

Used this libvpx video codec as well as libvorbis audio codec to transform a video file from MP4 to Webm:

$ ffmpeg –i input.mp4 –c:v libvpx –c:a libvorbis output.webm

Transform an audio file encrypted with Libopus codec from the file having extension from mp3 to ogg.

$ ffmpeg –i input.mp3 –c: a libopus output.ogg

Conclusion:

In this guide, we have explored how to install FFmpeg and how to utilize it in Centos 8. We have seen how to switch on the Epel repository, install the RPM Fusion repository, install the FFmpeg package, verify the installation of FFmpeg, and how to convert one media file to another format. I believe this guide will help you quickly understand the FFmpeg order in Centos 8.

]]>
CentOS 8 Restart Network https://linuxhint.com/centos-8-restart-network/ Tue, 24 Nov 2020 09:46:59 +0000 https://linuxhint.com/?p=77973

Among the most frequent system administration practices is the process of restarting the network. To connect your machine with the Internet, a sound networking service is always required. At times, due to undesirable issues, the networking service in a particular operating system may start malfunctioning. If the issue is temporary, then it can be resolved simply by restarting your networking service.

There are multiple methods that you can use in any operating system to restart the system’s networking service. Today, we walk you through the two primary methods of restarting the network service in CentOS 8, one of the most popular distributions of the Linux operating system.

If you are using a system based on CentOS 8 and are not able to establish a secure connection with your network, you would be shocked by how many issues a quick restart can solve. You can restart the Linux networking service using various commands, but you must execute the commands to restart the network using sudo or su commands as a root user.

Methods of Restarting Network Service on CentOS 8

To restart the Network service in CentOS 8, you may choose to follow any of the two methods listed below.

Method # 1: Using the “nmcli” Utility

Nmcli is a command-line application used for Network Manager access and network status monitoring. To use the “nmcli” utility to restart the Network service in CentOS 8, perform the following steps:

First, click the Activities tab in your CentOS 8 system, as highlighted in the image shown below:

Performing this action will cause a search bar to appear on your screen, in which you can search for the terminal. You may also open the terminal by using the shortcut Ctrl+Alt+T. The CentOS 8 terminal is shown in the following image:

To restart the Network service in CentOS 8 using the “nmcli” utility, first, turn off the networking service by running the command below in the terminal window that you just launched:

$ sudo nmcli networking off


Running this command will immediately turn off the networking service and the control of the terminal will be handed back to you without displaying any output, as shown in the following image:

Next, turn on the networking service by running the following command in the terminal:

$ sudo nmcli networking on


Running the above command will immediately start the networking service and the control of the terminal will be handed back to you without displaying any output, as shown in the following image:

In this method, you first turned off the networking service and then turned it on. Essentially, you have just restarted the networking service using the “nmcli” utility in CentOS 8.

Method # 2: Using the Network Manager Utility

The Network Manager is a software utility that seeks to make computer networks easier to use. To use the Network Manager utility to restart the Network service in CentOS 8, perform the following steps:

In the terminal, run the following command to start the networking service:

$ sudo systemctl start NetworkManager.service


Running this command will immediately start the networking service and the control of the terminal will be handed back to you without displaying any output, as shown in the following image:

Now, stop the networking service by running the following command in the terminal:

$ sudo systemctl stop NetworkManager.service


Running this command will immediately stop the networking service and the control of the terminal will be handed back to you without displaying any output, as shown in the following image:

Next, restart the networking service using the Network Manager utility by running the following command in the terminal:

$ sudo systemctl restart NetworkManager.service


Running this command will instantly restart the networking service and the control of the terminal will be handed back to you without displaying any output, as shown in the following image:

You can also verify whether your networking service has restarted by running the following command in the terminal:

$ sudo systemctl status NetworkManager.service


If the Network Manager utility has successfully managed to restart the networking service, then you will be able to see the “active (running)” status after executing the command shown above, as highlighted in the following image:

Conclusion

Restarting the network or connection is a task that any Linux user would have to go through. This article presented you with the two easiest and quickest methods of restarting the network service while using CentOS 8. The best thing about both these methods is that they do not require any prior installations; rather, you can just start following these methods straightaway. All you need to do is run a few basic commands, and your network service will be restarted within no time. We hope that we have provided you with the strategies necessary to deal with network restart problems in CentOS 8.

That is all, for now. I hope that you found the tutorial in this article useful for your purposes. After walking through the steps provided in the tutorial, you are now in this position to restart the network easily and conveniently in your CentOS 8 system by following any of the two methods presented.

]]>
How to Install Htop in Centos 8? https://linuxhint.com/how_to_install_htop_in_centos08/ Tue, 24 Nov 2020 09:11:56 +0000 https://linuxhint.com/?p=77905

Htop is more like an immersive Centos 8 system process viewer and device monitor. It shows resource-usage measures in color and helps you to conveniently keep track of the performance of your system as an enhancement. With both an additional array of choices and a clear picture on the board, it is the same as the standard main command. It shows details about the usage of Processor & RAM, tasks being done, average load, and uptime. Besides, Htop shows a list of all operating processes and can even show it in a tree-like structure. If you are interested to interactively control your device, then one of your best choices ought to be the Htop command. It runs on all distributions of Linux, and in most situations, is enabled by default.

In this tutorial, you will learn to install Htop on Centos 8 using the command-line.

The installation process for HTOS Centos 8 is as follows:

Open the terminal window in CentOS 8. Connect to the remote Centos 8 server using the ssh command or login panel.

Switch on EPEL repository

First, you’d have to make sure that your centos 8 has an epel repository installed and enabled. For this purpose, execute the following command:

$ sudo yum repolist

You can see that no epel repository is installed in the system, as shown in the image below.


You have to execute the following command to install the Centos 8 epel repository:

$ sudo yum install epel-release

Or

$ sudo yum –y install epel-release

Or

$ dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm


After that, you will be questioned to affirm your action. Type ‘y’ and then tap Enter to continue, as shown in the image. You can see that the epel repository will be installed in your system.


Using the repolist command, you can see that the epel repository is now installed in the system.


It’s important to understand how to check for packages of some sort. Consequently, enter the following yum command to check for the Htop packages in Centos 8:

$ sudo yum search htop

Install Htop Package

You can use any of the below-mentioned commands to install the HTOP package on your Centos 8:

$ sudo yum install htop

Or

$ dnf install htop

Or

$ dnf install –y htop


You will be questioned more than once to affirm your action. Type ‘y’ and then tap Enter to continue as shown. You can see that in the image, the epel repository will be installed in your system.


After the complete installation, to check whether the package is loaded or not, Open the terminal and then use the command below:

$ rpm –q htop

If your Htop package is successfully installed on your system, it will display its version and release information, as shown in the below image.


Enter the following command to get more details about the Htop package you just installed on your system:

$ dnf info htop

Launch Htop in Centos 8

You have to simply execute the below-mentioned command to launch the Htop package:

$ htop


The below-mentioned image has the information where any single bit of details about the device can be seen. The storage and swapping use can be checked out at the top. To exit the HTOP session, tap F10 or q from your keyboard.


Usage of keys is the main advantage of Htop. You can use F2 to setup, F3 to search, F4 to filter, and F9 to kill any process.

To get support with the used command, simply execute the following command:

$ htop --help


Conversely, you can access the man pages by running this simple command:

$ man htop


You will see the following output:

Show Processes of Specific User

Consequently, many arguments may be forwarded to the command. Let’s assume that aqsayasin is running a command. You have to use the following command to access aqsayasin processes:

$ htop –u aqsayasin

Or

$ htop --user=aqsayasin


Here in the main pane, you can conveniently check what choices and details are available. It will display all the system statistics for user aqsayasin, as seen below.

Set the Monochrome Color Scheme

One can use a monochrome color scheme in Htop using a very easy command as follows:

$ htop –C

Or

$ htop –no-color


As you can see in the image below, all the output is monochromatic, and there is no, other than one color, on-screen output.

Tree Visualization

It’s everybody’s favorite viewpoint since it helps you to grasp the hierarchy of each operation. Would you like to see tree visualization by default while Htop is running? For this purpose, try the command listed below:

$ htop –t

Or

$ htop --tree


To see tree visualization of a specific user, Click F5 or the “t” button while a specific user must have been selected. Here you will be able to see tree visualization of processes using system resources in the below image.

Limit Processes for Given PID’s

You can also show the processes of some specific PIDs using very simple commands. In this command, you just have to mention the PID of a particular user instead of its username as shown in the following:

$ htop –p PID

Here, PID is the Person ID assigned by the system. For example:

$ htop –p 3053

You can also limit the processes for more than one PID’s as follows:

$ htop -p PID1, PID2

Conclusion:

In this guide, we have explored how to install the Htop and how to utilize it in Centos 8. We have seen how to switch on epel repository, install Htop package, launch Htop in Centos 8, display specific user operations, fix monochromatic color scheme, tree representation, and restrict processes for relevant PIDs.

I believe this guide will help you quickly understand the HTOP order in Centos 8.

]]>
How to Check SELinux Status? https://linuxhint.com/how-to-check-selinux-status/ Sat, 21 Nov 2020 23:03:57 +0000 https://linuxhint.com/?p=77733 SELinux is a Mandatory Access Control (MAC) system that is developed by the NSA. As a substitute for Discretionary Access Control (DAC) that ships with most Linux distributions, SELinux was formed. SELinux 8 is a built-in security mechanism on which the security of all the Linux based systems depends. This security mechanism has three different modes of operation, i.e., “Enforcing”, “Permissive”, and “Disabled”, and you can toggle between these three modes according to your specific work requirements. Each of these modes serves a different purpose and you should understand it fully before changing the default mode of SELinux.

In our previous article on SELinux, we shared with you the method of disabling it. SELinux allows you the power to restrict the rights related to the process execution and mitigate the damage that might emerge from the exploitation of vulnerabilities in applications and systems. For this reason, unless you have a valid purpose to disable it, it is suggested to keep SELinux in enforcing mode. However, today we would like to share with you the method of checking the status of SELinux on CentOS 8.

Use Case of Checking the Status of SELinux on CentOS 8

After reading the introduction of this article, you might be wondering why do we need to check the status of SELinux in the first place. We have already stated that the security of the Linux based systems relies entirely on SELinux. It means that you should ensure all the time that SELinux is enabled and running on your system, unless you encounter a situation in which you have to disable it explicitly.

Since it is a mechanism that runs in the background, therefore, the users are not aware of its status. They need to specifically query for its status to know if SELinux is enabled or disabled. If it is enabled, then in which mode is it operating? Is it “Enforcing” or “Permissive”? In this situation, we must have proper ways where we can inquire for the status of SELinux.

For knowing the different methods of checking SELinux status on CentOS 8, you need to go through the following section of this article.

Methods of Checking SELinux Status on CentOS 8

For checking the status of SELinux on CentOS 8, you can use any of the three methods described below.

Method 1: Using the “sestatus” Command

This is the simplest and easiest method of finding out the status of SELinux as it only includes a one-liner command. For using the “sestatus” command for checking the status of SELinux on CentOS 8, you need to run this command in the following manner in your terminal:

$ sestatus

Running this command will display a lot of information other than the status of SELinux on CentOS 8. In our case, SELinux was enabled; therefore, its status is set to “enabled” as highlighted in the image shown below:

You have to modify the configuration file to disable SELinux on CentOS 8. To do that, you must first access the configuration file using any text editor of your preference. You can navigate the SELinux configuration file on CentOS 8 by running the affixed command on the terminal:

$ sudo nano /etc/selinux/config

After the successful execution of the above-mentioned command, the SELinux configuration file will be open in nano editor, i.e., default editor. You have to navigate the variable named as ‘SELinux’ and change its text from ‘enabled’ to ‘disabled’. After that, you have to save and close this configuration file. However, it is suggested to keep the SELinux status as enabled.

Method 2: Using the “getenforce” Command

This is another simple method of finding out the status of SELinux since this also involves a one-liner command. If you just want to know the mode of SELinux on which it is operating while being enabled on CentOS 8, you can make use of the “getenforce” command in the following manner:

$ getenforce

Running this command will not display any other information, rather it will simply reveal that your SELinux is currently operating in the “enforcing” mode as highlighted in the image shown below:

Method 3: Using the “/etc/selinux/config” File

If you are not satisfied by seeing only the status of SELinux on the terminal by running a simple command, then you can also choose to take a look at the /etc/selinux/config file in CentOS 8. All the information regarding the settings and status of SELinux is stored in the /etc/selinux/config file. Therefore, if you wish to see the status of SELinux on CentOS 8, you can also choose to display the contents of this file by running the “cat” command below:

$ cat /etc/selinux/config

As soon as you run this command, the configuration file of SELinux,  /etc/selinux/config, will be displayed on your terminal, from which you can easily figure out the status of SELinux on CentOS 8 as highlighted in the image shown below:

Conclusion

SELinux is a Linux utility that offers a workaround in the Linux kernel to help access control security policies. By using any of the three methods discussed in this article, you can easily find out the status of SELinux on CentOS 8. All three methods shared here are equally effective, and the user can choose to follow whichever method they like the most. By knowing the status of SELinux, you can also enable it if it has been accidentally or deliberately disabled in the past. By following this tutorial, you are now able to check the status of SELinux on your CentOS 8.

I hope this article will help you while checking SELinux status on your Linux operating system. In case you come up with any difficulty, you can ask in the comment section.

]]>
CentOS 8 add user and group https://linuxhint.com/centos-8-add-user-and-group/ Wed, 18 Nov 2020 18:47:51 +0000 https://linuxhint.com/?p=77219 Linux is a multiple user operating system. Multiple users and groups can share resources simultaneously while working on Linux Operating systems. In multiple command-line and GUI apps, each user may have different authorization levels and unique settings. Fortunately, if you are administering a Linux server, you will need to add users and groups. It could be troublesome for you to add users and groups without familiarity.

This article would clarify how to add users and groups on CentOS 8 Linux distribution by using the command line.

Add users in CentOS8

In CentOS, by using the ‘useradd’ command, we can make a new user, followed by the username that we will like to use. This command is very versatile, allowing you to build users who can log in or even users who are unable to login. Without any directory, the user would be created and blocked from logging in. For example, if you want to add a new user profile along without the user’s home directory, you must execute the following command:

$ sudo adduser username

Or

$ sudo useradd username

You can replace the username with “david” or any of your desired name.

Upon success, the command produces no output but generates the home directory of the user. The user can write, modify, and remove files and folders inside the home directory if the account is activated.

If you wish to set a password for a particular user, you can also do that. All you have to do is to execute a command followed by a username, and the system will then ask you to enter your password to validate it.

$ sudo passwd david

In Account Settings, you can see the users we had created recently.

However, you can set username and password in a single attempt, rather than executing different commands. You have to run the following command to set username and password simultaneously:

$ sudo useradd –m username –p password

You can set username and password as per your choice.

Here, “momi” is the username and “momin01” is the password for the said user.

Delete users in Centos 8

If you want to delete the already created users in CentOS 8, you can use the “userdel” command. This command is very easy to use, allowing you to delete users if you are administering the Linux operating system. For example, if you want to delete a user profile only, you must execute the following command appended below:

$ sudo userdel username

On the other hand, if you want to delete the user profile without the user’s home directory, you must execute the following command affixed below:

$ sudo userdel –r username

You can replace the username, as per your choice.

Add groups in Centos 8

A Group represents the users of the same properties. Every group in the Linux operating system were granted some particular rights. Every group can have more than one user in it. So if you wish to add a few new groups in CentOS 8, you have to write the following command to do this:

$ sudo groupadd groupname

For example, we replace groupname with class and city to create two new groups in our CentOS 8.

Add users to a group

Now, you can do it in a couple of moments if you would like to assign a newly created user to some particular group. We will utilize the ”usermod” command for this task. This command is quite simple to use. So you can add users to a group by simply following the appended command below:

$ sudo usermod –a –G groupname username

Groupname and username can be replaced, as per your choice.

While the user is being added to a new group, it is recommended to use –a flag. In case you are not using –a flag, the user will be detached from the group that is not written after –G flag. Here, “class” is the name of a group, and “david” is the name of the user that has been added.

This command may also be used differently but works the same, such as the example below:

$ sudo usermod –aG groupname username

Check users in a Group

How would you get to determine which users are already participants of some specific group? You can use the simple command written below:

$ grep groupname /etc/group

The above instruction will show the group related information. For example, if we execute this command for group ”class” and ”city” separately, as shown in the figure, it will display the following information regarding both groups.

Here, the red-colored text represents the group name, x represents the group password, numerical value, e.g., 1008 represents the group,ID, and the names of users, such as “david”, who are currently members of the specific group.

There is another command available to check the list of users currently present in the group, along with their user IDs. When you type this command for execution, the system will ask you for your password because you are executing the command with sudo privileges mentioned below. The command below will check users who are present in a group, along with their user ID, as shown below:

$ sudo lid –g groupname

Here, you can see two groups having different members present in them, along with their user IDs.

There is also another special way to figure out which users are present in the group. The command used for this specific purpose is as follows:

$ sudo groups username

In the above figure, you can see that “john” is in the group called ”class”, and “peter” in a group called ”city” as expected.

Conclusion

It is incredibly easy to adopt all the methods exemplified in this tutorial. Now, you can add multiple users, groups, and users in a group by following the commands that are revealed here. You can also verify the specific users and their groups by walking through the methods that are used in this article.

]]>
Centos 8 install and get started with MariaDB https://linuxhint.com/centos-8-install-and-get-started-with-mariadb/ Wed, 18 Nov 2020 18:40:15 +0000 https://linuxhint.com/?p=77185 MariaDB is a backward-compatible open and free-source database management framework that widely works as a binary drop-in MySQL substitution. It is an Oracle MySQL service community based and built branch. It has several threads and is a multi-user SQL database server. It was designed by the several initial creators of MySQL and by other members of the community. MariaDB is the recommended distribution if you are curious about MySQL vs. MariaDB. It should also function smoothly in the replacement of MySQL.

In this tutorial/article, we will illustrate to you how to install and get started with MariaDB on Centos 8.

Steps to install MariaDB on Centos 8

First, make sure you have Centos 8 installed in your system. Now, open Terminal in Centos 8. Another choice is to sign in using the user@centos-8-server-ip ssh commandssh. Then go through the following three steps:

  • MariaDB Installation on Centos 8
  • Securing the Centos 8 MariaDB server
  • Test the Installation

Let us see in detail all the steps and commands.

MariaDB installation on Centos 8

Use the following command to search for the MariaDB package:

$ sudo yum search mariadb

After that, use the following command to look out for the MariaDB server version:

$ sudo yum info mariadb

Installation

The first step of the installation is to add the following ‘dnf’ or ‘yum’ command as a root user:

$ sudo dnf install @mariadb

Or

$ sudo dnf install @mariadb-server

Or

$ sudo yum install mariadb-server

You will be asked to enter your current account password to proceed with the installation.

After that, you will be questioned to affirm your action to proceed further. Type ‘y’ and then tap Enter to continue as shown. The @mariadb package will load the MariaDB server and all its plugins.

Enable MariaDB

When the setup is complete, start the MariaDB service and enable it to begin the boot process instantly by typing the appended below command:

$ sudo systemctl enable --now mariadb

To confirm that the MariaDB service is working, check the status of the system using the following command:

$ sudo systemctl status mariadb

The output should demonstrate that the system is running and activated, as you can see in the affixed image.

Securing the Centos 8 MariaDB server

The MariaDB kit provides a script named MySQL secure installation that executes many security-related functions and determines the root password. Use this instruction to execute the protection script:

$ sudo mysql_secure_installation

You will be asked to enter your current account password to proceed after that. You will then be asked to place a password for the root account of MariaDB that has not yet been set, so you have to press ENTER as suggested. Note that it is for the root account of the database, not really for the root account of your Centos server itself. To set a passcode for the root database user, tap ‘y’ and then ENTER, and after that, go through all the instructions.

You have to accept all the safety recommendations by tapping ‘y’ and then ENTER after updating the password. It will delete anonymous users, disable remote root login, erase the test database, and load up the tables of privileges.

Now, on your CentOS 8, you had already configured and secured MariaDB, and it is ready to be used.

Test the Installation

You can check your installation and configuration, also get details about all this by communicating with the mysqladmin program, a client that allows you to operate administrative instructions. To link via the console to the MariaDB server as the root account, type the following instruction:

Mysql -u root –p

You may be asked for a password (-p), and the version will be shown. Output similar to this should be shown, as seen in the appended image.

The above instructions suggest that the installation was active on the server. You can now connect users and construct databases for your applications.

Create Database

Sign in as the root user first by using the below-mentioned command. It will ask you to type your password.

$ mysql –u root –p mysql

Add a new Database

Build a new database for MariaDB, named test. At the MariaDB command prompt, run the following instruction:

CREATE DATABASE test

Note: You can set the name of the database as per your choice.

Add new User

Build a new user for the test database named ‘student’. You can feel free to substitute secretePasswordHere with the real password you want to add. Try this command for adding a new user:

$ GRANT ALL ON test.* TO student@localhost IDENTIFIED BY 'secretePasswordHere';

Note: You can set the name of a new user in the database as per your choice.

You can also check the list of all databases present in MariaDB using the following command:

You can also exit MariaDB using a simple ‘quit’ command as follows:

$ quit

Connect to MariaDB database

You can easily connect to the MariaDB database by executing one of the following commands:

$ mysql –u student –p ’secretePasswordHere’ test

Or

$ mysql –u student –p test

Conclusion

This guide shows you the installation process and usage of MariaDB on Centos 8 and its connection via the command prompt to the MariaDB server, as well as adding databases and users to it. Your MariaDB server is ready and fully operational. You may now start building new databases and users by connecting to the MariaDB shell. Centos 8 also provide MySQL 8.0. If you like to install MySQL rather than MariaDB, you may also do so. Now, you are in a position, by walking through this tutorial, to install and get started with MariaDB on Centos 8.

]]>
CentOS 8 Disable Firewall https://linuxhint.com/disable-firewall-centos-8/ Mon, 16 Nov 2020 19:03:02 +0000 https://linuxhint.com/?p=77016 A firewall is considered as the “First Line of Defense” within any operating system. It prohibits any unauthorized access to your system hence preventing it from all potential harms. Therefore, it is highly recommended for every user to keep his Firewall enabled and running all the time. However, at times it happens that you are performing a critical task, and your Firewall causes hindrance in that task by even blocking your legitimate attempts to access your system. In such situations, you might feel the need of disabling your Firewall. Therefore, today we will learn the methods of disabling the Firewall in CentOS 8.

Methods of Disabling Firewall in CentOS 8

A Firewall in CentOS 8 can either be disabled temporarily or permanently. Below, we are going to share both methods with you one by one:

Method of Temporarily Disabling the Firewall in CentOS 8

In this method, we will learn to temporarily disable the Firewall in CentOS 8. It means that after following this method, our Firewall will immediately stop running; however, as soon as you will restart your system, it will be enabled once again. For temporarily disabling the Firewall in CentOS 8, you will need to perform the following steps:

Step 1: Checking the Status of the Firewall Daemon
First, we will launch the terminal in CentOS 8 by looking for it in the Activities search bar. The terminal of CentOS 8 is shown in the image below:

Before disabling our Firewall, we need to ensure if it is running or not in the first place. That can be done by checking its status with the following command:

$ sudo firewall –cmd --state

Since our Firewall was running by default, that is why the “running” status is shown in the image below:

Step 2: Temporarily Disabling the Firewall in CentOS 8
After ensuring that our Firewall is running, we can easily attempt to disable it temporarily by executing the following command in the terminal:

$ sudo systemctl stop firewalld

Running this command will not display any output on the terminal; rather, the control of the terminal will be handed back to you, as shown in the image below:

Step 3: Verifying if our Firewall has been Temporarily Disabled or not
Since the above-mentioned command did not display any output, that is why we are still unsure about whether our Firewall has been temporarily disabled or not. We can verify it by checking the status of our Firewall service in the following manner:

$ sudo systemctl status firewalld

If your Firewall has been disabled (temporarily) successfully, then you will be able to see the “inactive (dead)” status on your terminal as highlighted in the image shown below:

Now, whenever you restart your system, your Firewall will be enabled automatically; however, for the same session, it will remain disabled until you enable it explicitly.

Method of Permanently Disabling the Firewall in CentOS 8

In this method, we will learn to permanently disable the Firewall in CentOS 8. It means that after following this method, our Firewall will not stop running immediately; rather, a “disabled” status will appear instantly. Also, when you restart your system after following this method, the Firewall will still not be enabled until and unless you enable it explicitly. For permanently disabling the Firewall in CentOS 8, you will need to perform the following steps:

Step 1: Permanently Disabling the Firewall in CentOS 8
Even in this method, you can check the status of your Firewall daemon in the same manner as we explained in Method # 1. After doing that, you can permanently disable the Firewall in CentOS 8 by running the command stated below in your terminal:

$ sudo systemctl disable firewalld

If this command is executed successfully, the following messages will be displayed on your terminal:

Step 2: Verifying if our Firewall has been Permanently Disabled or not
Now we need to verify if our Firewall has been permanently disabled or not. This can be done by running the command stated below in your CentOS 8 terminal:

$ sudo systemctl status firewalld

Running this command will display the “active (running)” status on your terminal, unlike the method of temporarily disabling the Firewall, but your Firewall will be disabled as highlighted in the following image:

Step 3: Masking the Firewall Daemon Service
By now, our Firewall has been disabled permanently, which means that it will not be enabled automatically even after restarting your system; rather, you will have to manually enable it; however, at times, it happens that any other process or service running on your CentOS 8 system may manage to enable your Firewall. You can stop this from happening by masking your Firewall daemon by executing the command stated below in your CentOS 8 terminal:

$ sudo systemctl mask --now firewalld

If your Firewall daemon has been masked successfully, you will be able to see the following message on your CentOS 8 terminal:

Now, your Firewall daemon service has been masked, which means that you will not be able to enable it again unless you unmask it first. It also implies that no other process or service will now have the privileges of enabling your Firewall.

Conclusion

Depending upon your particular scenario, you can choose to either temporarily or permanently disable the Firewall in your CentOS 8 system by following either of the two methods explained in this article. However, it is highly recommended that as soon as you finish performing that task for which you have attempted to disable your Firewall, you enable it once again so that it can easily protect your system from all the viruses and malware as well as from any unauthorized access attempts.

]]>
Turn off SELinux on CentOS 8 https://linuxhint.com/turn_off_selinux_centos_8/ Sun, 15 Nov 2020 03:37:38 +0000 https://linuxhint.com/?p=76716

The term “SELinux” is an acronym for Security-Enhanced Linux, and it is defined as a mechanism that is implemented within the Linux based systems for providing an advanced level of security that is essentially based on policy rules. By following these rules, an administrator can allow or deny access to a certain object for any specified user. It means that the security of your Linux based systems relies heavily on this mechanism.

This mechanism works on three different modes of operation, i.e., Enforcing, Permissive, and Disabled. The first two modes work when you have enabled the SELinux mechanism, whereas the “Disabled” mode obviously works if your SELinux has been disabled. Also, the “Enforcing” mode works by applying all the policy rules that are written for SELinux, whereas the “Permissive” mode allows you to add new rules to the security policy.

However, at times, the rules defined in the SELinux security policy are so strict that they start causing trouble with your routine tasks, i.e., they might cause a hindrance in an important task that you are trying to perform. In this situation, you may prefer to turn off SELinux till the time you perform that task and then turn it on again once you are done. That is why today, we would like to share with you the method of turning off SELinux on CentOS 8.

Method of Turning off SELinux on CentOS 8

Turning off, SELinux is formally referred to as “Disabling SELinux.” So, for disabling SELinux on CentOS 8, you will have to execute the appended steps:

Step # 1: Checking the Status of SELinux on CentOS 8

First, you will be launching the terminal in CentOS 8, which is also shown in the image below:


Now you need to check the status of SELinux on CentOS 8. This step is mandatory so that you may know if SELinux is currently running on your system or not. You can check the status of SELinux on CentOS 8 by running the following command in your terminal:

$ sestatus


In our case, SELinux was enabled on our CentOS 8 system. Its “enabled” status is Illustrated in the following picture shown:


By seeing this status, you will immediately get to know that SELinux is currently enabled, which means that you can attempt to disable it now.

Step # 2: Opening the SELinux Configuration File on CentOS 8

For disabling SELinux on CentOS 8, you need to tweak its configuration file. For that, you first need to use any text editor of your choice to open the configuration file. The configuration file of SELinux can be accessed on CentOS 8 by executing the appended command in the terminal:

$ sudo nano /etc/selinux/config

We have tried to open the SELinux configuration file with the nano editor while providing the root user privileges.


As soon as you hit the Enter key after typing this command in your terminal, the SELinux configuration file will open up with your specified editor in the above-mentioned command. Our SELinux configuration file is shown in the image below:


Step # 3: Editing the SELinux Configuration File on CentOS 8

After opening the SELinux configuration file in CentOS 8, you need to edit it now. You have to locate the variable named “SELinux” and change its value to “disabled,” as highlighted in the following image:


Once you make this modification, you are supposed to close your SELinux configuration file after saving it. Doing this will cause your SELinux to disable on your CentOS 8 system; however, these changes will not take effect immediately. For making these changes to take effect, you will have to execute step no 4.

Step # 4: Restarting the CentOS 8 System

Now you need to reboot your system, which can either be done through the CentOS 8 GUI or through the CLI. Below we will state the command for rebooting your CentOS 8 system via the terminal:

$ sudo shutdown –r now


The “-r” flag along with the shutdown command is used to restart or reboot your CentOS 8 system, whereas the “now” keyword indicates that the said operation will be performed just now without any delay. After running this command, you will need to wait for a few seconds until your system is rebooted, after which you can proceed with the next step.

Step # 5: Verifying whether SELinux has been turned off or not on CentOS 8

Although we have performed all the steps of turning off SELinux on CentOS 8 up till now, however, we are still unsure about whether SELinux has actually been disabled or not. To verify this, we need to check the status of SELinux once again by running the following command in our terminal:

$ sestatus


Since now your SELinux has been successfully turned off. Therefore, you will be able to see the “disabled” status this time, as highlighted in the image shown below:

Conclusion

As we have already mentioned in the introduction of this article that the security of your Linux system relies heavily on SELinux. That is why it is highly recommended for you to keep it enabled all the time to avoid any unwanted security disasters. Although this method teaches you the way of turning off or disabling SELinux on your CentOS 8 system and is very effective as well, however, we would still like to advise you that as soon as you get done with the task that you intended to perform after disabling SELinux, you should immediately re-enable it. This can simply be done by changing the value of the “SELinux” variable in the SELinux configuration file to “enforcing” instead of “disabled” and rebooting your system after making this modification.

]]>
How to Disable SELinux on CentOS 8 https://linuxhint.com/disable_selinux_centos_8/ Sun, 01 Nov 2020 15:06:16 +0000 https://linuxhint.com/?p=75088

Often, Linux is regarded as one of the most secure platforms that’s reliable and high-performing. It comes with various tricks to offer a secure yet robust environment. One such feature is SELinux (Security-Enhanced Linux). It’s a kernel-level security architecture that enables system admin to have more control over who accesses the computer.

In the case of RHEL/CentOS, the SELinux feature is enabled by default. For security reasons, it’s recommended to keep in enabled. However, in certain situations, you may need to disable it. For example, not every app may function properly when SELinux is enabled. In such a case, you may want to disable SELinux.

Check out how to disable SELinux on CentOS.

Disabling SELinux

SELinux has an interesting origin history. It was first developed by the United States National Security Agency, also known as NSA as a patch to the Linux kernel using Linux Security Modules. It was released to the open-source community back in 2000. SELinux was integrated as a part of the Linux kernel starting from 2003.

There are two types of disabling SELinux. It’s possible to disable SELinux either temporarily or permanently. Depending on what your situation needs, follow the appropriate method. Note that the system is relatively more vulnerable when SELinux is disabled, so think twice before making the switch.

Checking SELinux status

First, check out the status of SELinux. Run the following command.

$ sestatus


SELinux temporary disable

The following procedures will disable SELinux temporarily. Once the system boots, it’ll switch back to the default SELinux configuration.

The setenforce command is the default tool to set the SELinux status. If you set the SELinux mode using setenforce, then you don’t have to reboot the system. Run the following command to set SELinux to permissive.

$ setenforce 0


Instead of using the numerical value, you can also use the alternative term “Permissive”.

$ setenforce Permissive


Check out the result of the setenforce command.

$ sestatus


Another way is to manually edit the SELinux configuration file. Open the file in your favorite text editor. I’ll be opening it in Vim.

$ vim /etc/selinux/config


Change the value of “SELINUX” to permissive.

$ SELINUX=permissive


Save the file. You may want to reboot the system after making this change. Check the result of editing the configuration file.

$ sestatus


SELinux permanent disable

This method will permanently disable SELinux. To enable SELinux again, you have to manually revert back the changes performed in this method.

Open up the SELinux configuration file with your favorite text editor. In my case, I’ll be using Vim.

$ vim /etc/sysconfig/selinux

Here, the “SELINUX” variable determines the state of SELinux. As you can see, there are three possible Scroll down to the “SELINUX” variable and change its value to “disabled”.

$ SELINUX=disabled


Save the file and close the editor. The system needs a reboot to take the changes into effect. After rebooting, check out the SELinux status.

$ sestatus

Enabling SELinux

Need to enable SELinux again? Depending on whichever method you followed, the way to enable SELinux will be different.

First, the temporary disable. If you used the setenforce command to disable SELinux, then a simple reboot of the system will bring the SELinux status back to default. If rebooting isn’t an option, then use the setenforce command again to manually re-assign the value.

$ setenforce 1


As we’ve seen earlier, it’s also possible to use an alternative value with setenforce .

$ setenforce Enforcing


If you’ve manually edited the SELinux configuration file, then you have to revert it back manually. Open up the configuration file in a text editor.

$ vim /etc/selinux/config

Set the value of “SELINUX” back to “enforcing”. Then, save the file and reboot the system.

$ SELINUX=enforcing


Check the SELinux status to verify the changes.

$ sestatus

Final thought

Disabling SELinux is a very simple task. This method should also work with other distros that have SELinux support.

Interested in making your system more secure? Then check out the Linux security hardening checklist. It should act as a quick but useful introduction to the world of Linux security.

Happy computing!

]]>
Configure iSCSI Storage Server on CentOS 8 https://linuxhint.com/iscsi_storage_server_centos/ Sun, 29 Mar 2020 09:54:42 +0000 https://linuxhint.com/?p=57257 In this article, I am going to show you how to configure iSCSI storage server on CentOS 8. So, let’s get started.

Basics of iSCSI:

iSCSI storage server is used to share block devices such as HDD/SSD partitions, or LVM partitions, or block files on the network. iSCSI clients can use these shares over the network just as any ordinary HDD or SSD mounted to it. The iSCSI client can format these disks, mount them and store files and directories as usual.

Fig 1: iSCSI server-client architecture

Fig 1: iSCSI server-client architecture

Each iSCSI client has an initiator ID which is used to connect to the targets on the server.

The targets are shares on the iSCSI server. Each target consists of a unique name (IQN), the path of the block device (i.e. disk partition or block file), the initiator ID that can connect to this target, and an optional username-password based authentication system.

In fig 1, the iSCSI storage server allows 3 initiators (3 iSCSI clients) to connect to 4 targets. initiator01 can connect to target01 and target02, initiator02 can connect to target03, and initiator03 can connect to target04.

iSCSI Target and Initiator Naming Conventions:

The iSCSI target name and initiator name must be unique.

The target naming format is:

iqn.YYYY-MM.reverse-domain-name:target-name

Example:

 iqn.2020-03.com.linuxhint:www, iqn.2020-03.com.linuxhint:logs,
 iqn.2020-03.com.linuxhint:user-bob etc.

The initiator naming format is:

iqn.YYYY-MM.reverse-domain-name:initiator-name

Example:

iqn.2020-03.com.linuxhint:initiator01, iqn.2020-03.com.linuxhint:initiator02,
 iqn.2020-03.com.linuxhint:initiator03 etc.

Network Topology:

Fig 2: Network topology used in this iSCSI server article

The network topology used in this article is given in fig 2. Here, I will configure a CentOS 8 machine as an iSCSI server. The iSCSI server has a static IP address 192.168.20.197. The iSCSI client is also on the network 192.168.20.0/24. So, it can access the iSCSI server.

Setting Up Static IP Address:

You must set up a static IP address on your CentOS 8 machine which you will configure as an iSCSI server. To set up a static IP address on CentOS 8, check my article Configuring Static IP on CentOS 8.

The CentOS 8 machine I will configure as an iSCSI server in this article has the static IP address 192.168.20.197. It will be different for you. So, make sure to replace it with yours from now on.

$ ip a

Installing iSCSI Server Tools:

First, update the DNF package repository cache as follows:

$ sudo dnf makecache

You must have targetcli tool installed on the CentOS 8 machine which you want to configure as an iSCSI server.

To install targetcli, run the following command:

$ sudo dnf install targetcli

To confirm the installation, press Y and then press <Enter>.

targetcli should be installed.

Now, to test whether the targetcli tool is working, start targetcli as follows:

$ sudo targetcli

targetcli should start.

targetcli is working perfectly.

> ls

Now, exit out of the targetcli tool.

> exit

Now, start target service as follows:

$ sudo systemctl start target

Now, add target service to the system startup as follows:

$ sudo systemctl enable target

Sharing File Blocks:

You can share file blocks as storage devices via iSCSI.

First, create a new directory where you want to keep all the file blocks as follows:

$ sudo mkdir -pv /iscsi/blocks

Now, start targetcli as follows:

$ sudo targetcli

Now, create a new 1 GB fileio backstore web1 in the path /iscsi/blocks/web1.img as follows:

> /backstores/fileio create web1 /iscsi/blocks/web1.img 1G

The web1 1GB file block should be created in the path /iscsi/blocks/web1.img

> ls /

Now, create a new iSCSI target iqn.2020-03.com.linuxhint:web as follows:

> /iscsi create iqn.2020-03.com.linuxhint:web

The iSCSI target iqn.2020-03.com.linuxhint:web should be created.

> ls /

Now, navigate to the target’s TPG (Target Portal Group) as follows:

> /iscsi/iqn.2020-03.com.linuxhint:web/tpg1/

This is how the TPG of the target should look like.

> ls

Now, create a LUN from the web1 fileio backstore you’ve created earlier.

> luns/ create /backstores/fileio/web1

LUN 0 should be created.

> ls

Now, create an ACL for the initiator iqn.2020-03.com.linuxhint:init1 so that the iSCSI client can access the LUNS in this target.

> acls/ create iqn.2020-03.com.linuxhint:init1

An ACL should be created and LUN 0 should be mapped to it.

> ls

Now, save the configuration.

> / saveconfig

Now, exit out of the targetcli interface.

> exit

Sharing HDD/SSD or HDD/SSD Partitions:

You can also share the whole HDD/SSD or one or more HDD/SSD partition via iSCSI. If you share the whole HDD/SSD, the partitions of that HDD/SSD will also be accessible from the initiator or the iSCSI client.

First, find the HDD/SSD name or HDD/SSD partition name that you want to share with the following command:

$ sudo lsblk

Here, nvme0n2 is the SSD name and nvme0n2p1, nvme0n2p2 and nvme0n2p3 are the partitions of  that SSD.

Now, start targetcli as follows:

$ sudo targetcli

Now, create a block backstore data1 using the HDD/SSD or HDD/SSD partition as follows.

> /backstores/block create data1 /dev/nvme0n2p1

NOTE: Here, I used the SSD partition /dev/nvme0n2p1.

The data1 block backstore should be created.

> ls /

Now, create a new iSCSI target iqn.2020-03.com.linuxhint:data as follows:

> /iscsi/ create iqn.2020-03.com.linuxhint:data

A new iSCSI target should be created.

> ls /

Now, navigate to the TPG of the target as follows:

> /iscsi/iqn.2020-03.com.linuxhint:data/tpg1/

The TPG of the target should look as follows.

> ls

Now, create a new LUN from the data1 block backstore you’ve created earlier.

> luns/ create /backstores/block/data1

A new LUN should be created.

> ls

Now, create an ACL for the initiator iqn.2020-03.com.linuxhint:init1 so that the iSCSI client can access the LUNS in this target.

> acls/ create iqn.2020-03.com.linuxhint:init1

An ACL should be created and LUN 0 should be mapped to it.

> ls

Now, save the configuration.

> / saveconfig

Now, exit out of the targetcli interface.

> exit

Configuring Firewall:

Now, allow access to the iSCSI port 3260 through the firewall as follows:

$ sudo firewall-cmd --add-service=iscsi-target --permanent

For the changes to take effect, run the following command:

$ sudo firewall-cmd --reload

Installing iSCSI Client Tools:

On the iSCSI client, you must have iscsi-initiator-utils package installed in order to access the shared iSCSI storage devices.

First, update the DNF package repository cache as follows:

$ sudo dnf makecache

Now, install iscsi-initiator-utils package on the client machine as follows:

$ sudo dnf install iscsi-initiator-utils

To confirm the installation, press Y and then press <Enter>.

iSCSI client utilities should be installed.

Now, open the /etc/iscsi/initiatorname.iscsi configuration file as follows:

$ sudo vi /etc/iscsi/initiatorname.iscsi

Now, set your initiator name to InitiatorName and save the file.

Now, scan for the targets as follows:

$ sudo iscsiadm -m discovery -t sendtargets -p 192.168.20.197

Now, you can login to the targets as follows:

$ sudo iscsiadm -m node --login

The iSCSI storage devices should be attached to your client as you can see in the screenshot below.

$ sudo lsblk

Now, start the iscsi and iscsid services as follows:

$ sudo systemctl start iscsi
$ sudo systemctl start iscsid

The iscsi and iscsid services should be running.

$ sudo systemctl status iscsi iscsid

Now, add the iscsi and iscsid service to the system startup as follows:

$ sudo systemctl enable iscsi
$ sudo systemctl enable iscsid

Mounting iSCSI Disk:

You can mount the iSCSI disks permanently on the iSCSI client using the /etc/fstab file.

First, format the iSCSI disk if it’s not already formatted.

$ sudo mkfs.ext4 -L data /dev/sda

Now, create a directory (mount point) for the iSCSI disk as follows:

$ sudo mkdir /data

Now, find the UUID of the iSCSI disk that you want to mount as follows:

$ sudo blkid

The UUID in my case is c1cbfa44-a8a9-4343-a88e-769b63a6e006. It will be different for you. So, make sure to replace it with yours in the /etc/fstab file.

Now, open the /etc/fstab file as follows:

$ sudo vi /etc/fstab

Now, add the following line to the /etc/fstab file.

UUID=c1cbfa44-a8a9-4343-a88e-769b63a6e006
/data     ext4       defaults,_netdev   0 0

Make sure to add the _netdev option in the /etc/fstab file while mounting iSCSI disks. Otherwise, your CentOS 8 iSCSI client may not boot.

Now, you can mount the iSCSI disk for the first time as follows:

$ sudo mount /data

As you can see, the iSCSI disk is mounted correctly.

So, that’s how you configure iSCSI storage server and client on CentOS 8. Thanks for reading this article.

]]>
Configuring PXE Network Boot Server on CentOS 8 https://linuxhint.com/pxe_network_boot_centos8/ Mon, 16 Mar 2020 18:24:35 +0000 https://linuxhint.com/?p=56626 In this article, I am going to show you how to configure CentOS 8 server as a PXE network boot server to boot CentOS 8 DVD installer via PXE and install CentOS 8 on your computer. So, let’s get started.

NOTE: Make sure to set SELinux to permissive mode on your CentOS 8 machine. Otherwise, the steps shown in this article won’t work. Covering SELinux is out of the scope of this article.

Network Topology:

Figure 1: Network topology for PXE boot article

Figure 1: Network topology for PXE boot article

Here, linuxhint-s80 will be configured as a PXE boot server. It will also be assigned a static IP address 192.168.15.1. Other computers on the network will be able to boot into CentOS 8 installer from the PXE boot server.

Setting Up Static IP Address:

You must set up a static IP on your CentOS 8 machine before you move any further. For assistance on configuring a static IP address on your CentOS 8 machine, check my article Configuring Static IP on CentOS 8.

I will configure ens256 network interface for PXE booting on my CentOS 8 machine. It may be different for you. So, run the following command to find out the network interface you want to use.

$ ip a

I used nmtui to configure ens256 interface for PXE booting as follows.

Configuring DHCP and TFTP for PXE Booting:

You have to configure a DHCP and a TFTP server for PXE boot. You can use dnsmasq for that.

First, update the YUM package repository cache with the following command:

$ sudo dnf makecache

Now, install the dnsmasq with the following command:

$ sudo dnf install -y dnsmasq

dnsmasq should be installed.

Now, rename the original /etc/dnsmasq.conf file to /etc/dnsmasq.conf.backup as follows:

$ sudo mv -v /etc/dnsmasq.conf /etc/dnsmasq.conf.backup

Now, create an empty dnsmasq.conf file with the following command:

$ sudo vi /etc/dnsmasq.conf

Now, type in the following lines in the dnsmasq.conf file and save it.

interface=ens256
bind-interfaces
domain=linuxhint.local
dhcp-range=ens256,192.168.15.100,192.168.15.240,255.255.255.0,8h
dhcp-option=option:router,192.168.15.1
dhcp-option=option:dns-server,192.168.15.1
dhcp-option=option:dns-server,8.8.8.8
enable-tftp
tftp-root=/netboot/tftp
dhcp-boot=pxelinux.0,linuxhint-s80,192.168.15.1
pxe-prompt="Press F8 for PXE Network boot.",5
pxe-service=x86PC,"Install OS via PXE",pxelinux

Now, create the required directory structure for PXE booting as follows.

$ sudo mkdir -pv /netboot/tftp/pxelinux.cfg

Now, restart the dnsmasq service with the following command:

$ sudo systemctl restart dnsmasq

dnsmasq service should be running.

$ sudo systemctl status dnsmasq

Now, add the dnsmasq service to the system startup as follows:

$ sudo systemctl enable dnsmasq

Installing and Configuring PXE Bootlaoder:

Now, you have to install the PXE bootloader files and copy them over to the TFTP root directory.

To install the PXE bootloader files, run the following command:

$ sudo dnf install -y syslinux

Once syslinux is installed, copy the required files to the /netboot/tftp directory as follows:

$ sudo cp -v /usr/share/syslinux/{pxelinux.0,menu.c32,ldlinux.c32,libutil.c32}
/netboot/tftp/

Installing Apache Web Server:

CentOS 8 support PXE booting over HTTP. So, you must use a web server to server the all the required files over HTTP in order to boot CentOS 8 installer via PXE. In this article, I will use Apache HTTP server.

You can install Apache HTTP server with the following command:

$ sudo dnf install -y httpd

Apache HTTP server should be installed.

Now, make a symbolic link /netboot/www of the /var/www/html directory for easier management of the PXE boot server as follows:

$ sudo ln -s /var/www/html /netboot/www

Now, start the httpd service as follows:

$ sudo systemctl start httpd

The httpd service should be running.

$ sudo systemctl status httpd

Now, add the httpd service to the system startup with the following command:

$ sudo systemctl enable httpd

 

Preparing CentOS 8 DVD for PXE Boot:

You can download CentOS 8 installer DVD image with the following command:

$ wget http://isoredirect.centos.org/centos/8/isos/x86_64/
CentOS-8.1.1911-x86_64-dvd1.iso

NOTE: The DVD image is about 7 GB in size. So, it will take a long time to download. That’s why, I used an older version of the DVD image I already had in my external hard drive. The process is the same for the new version of the DVD image. Just, make sure to replace the file name with the new one. That’s all.

Once you have CentOS 8 installer DVD downloaded, mount the DVD image in the /mnt directory as follows.

$ sudo mount -o loop CentOS-8-x86_64-1905-dvd1.iso /mnt

Now, create the required directories for storing the CentOS 8 installer files and bootloader files as follows.

$ sudo mkdir -v /netboot/{tftp,www}/centos8

Now, copy the contents of the ISO file to the /netboot/www/centos8/ directory as follows:

$ sudo rsync -avz /mnt/ /netboot/www/centos8

The contents of the CentOS 8 installer DVD image should be copied to /netboot/www/centos8/ directory.

Now, copy the initrd.img and vmlinuz files from the /netboot/www/centos8/images/pxeboot/ directory to the /netboot/tftp/centos8/ directory as follows:

$ sudo cp -v /netboot/www/centos8/images/pxeboot/{initrd.img,vmlinuz}
/netboot/tftp/centos8/

Now, you can unmount the CentOS 8 installer DVD image and delete it if you want.

$ sudo umount /mnt

$ rm CentOS-8-x86_64-1905-dvd1.iso

Adding PXE Boot Entry for CentOS 8:

Now, you have to add a boot entry for CentOS 8 PXE booting on the /netboot/tftp/pxelinux.cfg/default file.

Open the configuration file /netboot/tftp/pxelinux.cfg/default for editing as follows.

$ sudo vi /netboot/tftp/pxelinux.cfg/default

Now, type in the following lines in the /netboot/tftp/pxelinux.cfg/default file and save it.

default menu.c32
label install_centos8
menu label ^Install CentOS 8
menu default
kernel centos8/vmlinuz
append initrd=centos8/initrd.img ip=dhcp inst.repo=http://192.168.15.1/centos8/

Configuring the Firewall:

Now, you have to open some ports from your firewall for the PXE boot server to work.

Allow the DHCP, HTTP, TFTP services through the firewall as follows.

$ sudo firewall-cmd --add-service={dhcp,http,tftp} --permanent

Also allow the UDP port 4011 and 69 through the firewall as follows.

$ sudo firewall-cmd --add-port={4011/udp,69/udp} --permanent

For the changes to take effect, run the following command:

$ sudo firewall-cmd --reload

Installing CentOS 8 via PXE:

Now, on the PXE client where you want to install CentOS 8 over the network via PXE, go to the BIOS and select Network Boot.

When you see the following message, press <F8>.

Now, select Install OS via PXE and press <Enter>.

You will only have one option. So, just press <Enter>.

CentOS 8 installer is booting over the network via PXE.

The CentOS 8 graphical installer should start. Now, you can install CentOS 8 as usual. If you need any assistance on installing CentOS 8, you may check my article How to Install CentOS 8 Server.

CentOS 8 installer configuration window.

CentOS 8 being installed.

CentOS 8 installation completed.

CentOS 8 installed over the network via PXE. It’s also running correctly.

So, that’s how you configure PXE network boot server on CentOS 8 and boot CentOS 8 installer DVD image over the network via PXE. Thanks for reading this article.

]]>
Configure DHCP Server on CentOS 8 https://linuxhint.com/dhcp_server_centos8/ Mon, 16 Mar 2020 17:35:16 +0000 https://linuxhint.com/?p=56593 DHCP server is used to automatically assign IP addresses to servers, laptops, desktops, and other devices on the network.

In this article, I am going to show you how to configure DHCP server on CentOS 8. So, let’s get started

Network Topology:

Figure 1: Network topology used in DHCP server article

Here, I have a dhcp-server where a static IP 192.168.15.1 is configured. The DHCP server will automatically assign IP addresses, default route address, DNS server address to other devices on the network 192.168.15.0/24.

Setting Up Static IP:

First, you have to set up a static IP on the network interface of your CentOS 8 machine which you will be configuring as a DHCP server.

The network interface name in my case is ens256.

You can run the following command to find out yours.

$ ip a

You can set up a static IP address on your CentOS 8 machine very easily using nmtui command. For a detailed instruction on this, check my article Configuring Static IP on CentOS 8.

At this point, the static IP 192.168.15.1 is set on the CentOS 8 machine.

Installing DHCP Server:

DHCP server package is available in the official package repository of CentOS 8. So, it is very easy to install.

First, update the DNF package repository cache with the following command:

$ sudo dnf makecache

Now, install DHCP server package with the following command:

$ sudo dnf install dhcp-server

Now, to confirm the installation, press Y and then press <Enter>.

DHCP server should be installed.

Configuring DHCP Server:

The main configuration file of the DHCP server is /etc/dhcp/dhcpd.conf.

To configure the DHCP server, edit the /etc/dhcp/dhcpd.conf configuration file with the following command:

$ sudo vim /etc/dhcp/dhcpd.conf

Now, type in the following lines in the /etc/dhcp/dhcpd.conf file.

default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
authoritative;
subnet 192.168.15.0 netmask 255.255.255.0 {
range 192.168.15.50 192.168.15.200;
option routers 192.168.15.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 8.8.8.8, 8.8.4.4;
}

Here, the DHCP server will reserve the IP address for at least 600 seconds or 10 minutes (default-lease-time) and at max 7200 seconds or 2 hours (max-lease-time) for a specific device.

The subnet section defines the DHCP configuration for the network subnet 192.168.15.0/24.

range defines the assignable IP address range of the DHCP pool.

routers defines the default gateway.

subnet-mask defines the default subnet mask that will be assigned to each host.

domain-name-servers defines the DNS nameservers which will be assigned to each host.

You can add one or more subnets in the same configuration file. Just add as many subnet blocks as you need.

Once you’re done working with the configuration file, start the dhcpd service with the following command:

$ sudo systemctl start dhcpd

As you can see, the dhcpd service is running.

$ sudo systemctl status dhcpd

Now, add the dhcpd service to the system startup of CentOS 8. This will automatically start the dhcpd service on boot.

$ sudo systemctl enable dhcpd

If you make any changes to the DHCP server configuration file while the dhcpd service is running, make sure to restart the dhcpd service for the changes to take effect.

$ sudo systemctl restart dhcpd

Configuring the Firewall:

Once you start the dhcpd service, the DHCP server should be running on UDP port 67 as you can see in the screenshot below.

$ sudo netstat -tulpen

Now, allow access to the DHCP server running on the UDP port 67 through the firewall with the following command:

$ sudo firewall-cmd --add-service=dhcp --permanent

Now, for the changes to take effect, run the following command:

$ sudo firewall-cmd --reload

Testing the DHCP Server:

As you can see, the Linux Mint 19.3 machine automatically got the IP address 192.168.15.50 from the DHCP server.

The Windows 10 computer also got an IP address 192.168.15.51 from the DHCP server.

Checking Hosts Information from the DHCP Server:

You can check the information about the hosts assigned IP addresses via the DHCP server very easily by reading the /var/lib/dhcpd/dhcpd.leases file.

As you can see, a lot of information about the hosts which assigned IP addresses via the DHCP server is stored in the file /var/lib/dhcpd/dhcpd.leases.

Here, the IP address leased to the host is displayed.

Here, the datetime when the IP address is leased to the host is stored in the starts section. The datetime when the lease will expire is stored in the ends section. The datetime when the host contacted the DHCP server is stored in the cltt section.

Here, binding state is active, which means the leased IP address is currently active for the host. next binding state is free, which means once the lease is expired, the IP address will be free to be leased to other devices.

Here, hardware ethernet stores the MAC address of the network interface of the host. The client-hostname stores the hostname of the host.

So, this is how you configure DHCP server on CentOS 8. Thanks for reading this article.

]]>
How to Use Cockpit Web Console on CentOS 8 https://linuxhint.com/cockpit_web_console_centos8/ Sun, 29 Dec 2019 05:40:41 +0000 https://linuxhint.com/?p=52463 Cockpit is a web-based administration panel. Cockpit is used to administer GNU/Linux operating system from the web browser.  In this article, I am going to show you how to install and use Cockpit web console on CentOS 8. So, let’s get started.

Prerequisites:

You must have a CentOS 8 server or virtual machine. You must have access to your CentOS 8 server’s console. You may also access your CentOS 8 server’s console via SSH.

You also need to know the IP address, the login username and password of your CentOS 8 server.

You can find the IP address of your CentOS 8 server with the following command:

$ ip a

As you can see, the IP address of my CentOS 8 server is 192.168.20.145. It will be different for you. So, make sure to change it with yours from now on.

SSH Into CentOS 8 Server:

You can SSH into your CentOS server with the following command:

$ ssh <Username>@<IP Address>

Now, type in yes and press <Enter>.

Now, type in the password of your login user and press <Enter>.

You should be logged in.

Installing Cockpit Web Console:

Now, update the CentOS 8 package repository cache with the following command:

$ sudo dnf makecache

CentOS 8 package repository cache should be updated.

Now, install Cockpit with the following command:

$ sudo dnf install cockpit

Now, press Y and then press <Enter> to confirm the installation.

The DNF package manager should start downloading all the required packages.

You may be asked to confirm the GPG key. Press Y and then press <Enter> to confirm it.

The installation should continue.

Cockpit should be installed at this point.

Automatically Start Cockpit on System Boot:

Now, check the status of the Cockpit web service socket with the following command:

$ sudo systemctl status cockpit.socket

As you can see, the Cockpit web service socket is inactive (not running) and disabled (won’t automatically start on system boot).

Now, start the Cockpit web service socket with the following command:

$ sudo systemctl start cockpit.socket

Now, add Cockpit web service socket to the system startup of CentOS 8 with the following command:

$ sudo systemctl enable cockpit.socket

Cockit web service socket should be added to the system startup of CentOS 8.

Now, restart your CentOS 8 server with the following command:

$ sudo reboot

Once your CentOS 8 server starts, the Cockpit web service socket should be active (running) and enabled (will automatically start on system boot).

Accessing Cockpit Web Console:

Once you enable Cockpit web console, every time you login to your CentOS 8 server, it will print the URL of your Cockpit web console.

You can copy and paste the Cockpit web console URL on your web browser and access Cockpit. Once you visit the Cockpit web console URL, you will see the Cockpit login page as you can see in the screenshot below.

Now, type in root as the User name and the root password as the Password. Also, check Reuse my password for privileged tasks checkbox. Now, click on Log In.

You should be logged in to Cockpit web console.

Managing and Monitoring CentOS 8 Server using Cockpit Web Console:

In the Systems tab, information and statistics (CPU usage, Memory and Swap usage, Disk I/O usage, Network usage) about your CentOS 8 server should be displayed.

You can Restart or Shut Down your CentOS 8 server from the Power Options dropdown menu.

You can check all the system logs from the Logs tab. You can filter the log messages by Severity as well.

You can also click on any log message to find more information about it.

You can find information about the Network from the Networking tab.

From the top section, you can find the total upload and download statistics.

You can find all the available network interfaces names, IP addresses assigned to them, the download and upload speed of each of these network interfaces from the Interfaces section.

You can also click on each of the network interfaces to learn more about them or configure them.

You can see network specific logs from the bottom section.

You can also check network firewall settings, enable or disable firewall from the Firewall section.

From the Firewall section, you can also find all the active firewall rules and manage them. You can also add new firewall rules.

You can manage your CentOS 8 user accounts and add new user accounts from the Accounts tab.

You can manage your CentOS 8 services from the Services tab. You can also navigate to different type of services from the buttons on the top.

You can click on any service to learn more about it. You can stop, restart, start, enable/disable a service from here as well.

From the Software Updates tab, you can check for system updates. All the available updates should be listed.

If you want to update the system, click on Install All Updates.

You can also enable/disable automatic updates from here as well.

From the Terminal tab, you can bring the CentOS 8 command line.

You can type in any commands here and get outputs as usual. To reset the terminal, click on Reset.

You can set SELinux to enforcing mode or permissive mode using the Enforce policy toggle button from the SELinux tab. From here, you can also see all the SELinux alerts.

Once you’re done, you can logout of Cockpit web console. To do that, click on the dropdown menu at the top right corner and click on Log Out.

So, that’s how you install Cockpit web console on CentOS 8 and use the Cockpit web console to manage your CentOS 8 server from the web browser. Thanks for reading this article.

]]>
How to Install Hyper.js Terminal on CentOS 8 https://linuxhint.com/install_hyperjs_terminal_centos8/ Tue, 26 Nov 2019 09:06:42 +0000 https://linuxhint.com/?p=50951 Hyper terminal is built with web technologies such as HTML, CSS, JavaScript, Electron.js etc. It looks very modern and has lots of customization options. In this article, I am going to show you how to install Hyper terminal on CentOS 8. So, let’s get started.

Downloading Hyper Terminal:

Hyper terminal is not available in the official package repository of CentOS 8. But you can easily download it from the official website of Hyper terminal and install it on CentOS 8 very easily.

First, visit the official website of Hyper terminal from your favorite browser and click on Download.

Now, click on the AppImage download link  as marked in the screenshot below.

Your browser should prompt you to save the Hyper AppImage file. Click on Save File.

Your browser should start downloading Hyper AppImage file. It may take a while to complete.

Installing Hyper Terminal Dependencies:

Hyper AppImage depends on libXss.so.1. It may not be available on your CentOS 8 machine. libXss.so.1 is available in the libXScrnSaver package. So, make sure you have libXScrnSaver package installed on your CentOS 8 machine.

You can install libXScrnSaver package using DNF package manager as follows:

$ sudo dnf install libXScrnSaver

To confirm the installation, press Y and then press <Enter>.

libXScrnSaver should be installed.

Installing Hyper Terminal:

Once Hyper AppImage is downloaded and libXScrnSaver is installed, navigate to the ~/Downloads directory as follows:

$ cd ~/Downloads

As you can see, the Hyper AppImage file hyper-3.0.2-x86_64.AppImage is there.

$ ls -lh

Now, add execute permission to the Hyper AppImage file hyper-3.0.2-x86_64.AppImage as follows:

$ chmod +x hyper-3.0.2-x86_64.AppImage

Now, hyper-3.0.2-x86_64.AppImage file should have execute permission.

Now, you have to move the Hyper AppImage file to somewhere safe. So, you won’t accidentally delete it.

I’ve decided to put the Hyper AppImage file in ~/.local/apps/ directory in this article. It should be a safe enough directory.

First, create the directory ~/.local/apps/ with the following command:

$ mkdir ~/.local/apps

Now, move the Hyper AppImage to the newly create directory ~/.local/apps/ with the following command:

$ mv -v hyper-3.0.2-x86_64.AppImage ~/.local/apps/

The Hyper AppImage file should be moved to the newly created directory.

Now, run Hyper AppImage app as follows:

$ ~/.local/apps/hyper-3.0.2-x86_64.AppImage

On first run, it will ask you whether you want to create a desktop shortcut for easily accessing Hyper terminal later. Click on Yes.

Hyper terminal should start.

Starting Hyper Terminal:

Once Hyper terminal is installed, you can start Hyper terminal from the Application Menu of CentOS 8.

Hyper terminal should start.

You can run any command you like on Hyper terminal as you usually do in other terminal apps. No difference there.

Hyper Terminal Configuration File:

The configuration file of Hyper terminal is in the path ~/.hyper.js

To configure Hyper terminal, open Hyper terminal and click on the hamburger menu.

Then, go to Edit > Preferences…

Hyper configuration file ~/.hyper.js should be opened with your default text editor. It is a nicely formatted JSON file. It is very self-explanatory. You should be able to configure it very easily.

But if you need any assistance configuring Hyper terminal, please check the article How to Install and Use Hyper Terminal on Ubuntu 18.04 LTS at LinuxHint.com.

Installing Rainglow Themes on Hyper Terminal:

Rainglow has a rich set of color schemes. Rainglow officially supports Hyper terminal. You can easily install Rainglow plugin on Hyper terminal.

First, install Git with the following command:

$ sudo dnf install git

To confirm the installation, press Y and then press <Enter>.

Git should be installed.

Now, navigate to the local plugins directory of Hyper terminal as follows:

$ cd ~/.hyper_plugins/local

Now, clone the Rainglow Hyper git repository with the following command:

$ git clone https://github.com/rainglow/hyper.git rainglow

The Rainglow Git repository should be cloned.

A new directory rainglow/ should be created.

Now, open the Hyper configuration file ~/.hyper.js and scroll to the end of the configuration file. Find the localPlugins parameter and add rainglow there as marked in the screenshot below.

Now, go to the top of the configuration file and after the updateChannel property, add a new property rainglow.

The format of the rainglow property:

rainglow: 'THEME_NAME'

Here I’ve set the peacock theme.

All the themes are saved in the ~/.hyper_plugins/local/rainglow/colors directory as you can see in the screenshot below.

$ ls ~/.hyper_plugins/local/rainglow/colors

You can go to the official Rainglow Preview website to find out how each theme looks like. Every Rainglow theme has 3 variants,

  • Normal (Dark)
  • Light
  • Contrast

I went to the Rainglow Preview website and I really liked the Earthsong theme. Let’s set this theme on Hyper terminal.

You can find the theme file name (in my case Earthsong) using grep as follows:

$ ls ~/.hyper_plugins/local/rainglow/colors/ | grep earth

As you can see, the theme I picked has 3 files earthsong-contrast.js (Contrast variant), earthsong.js (Normal variant) and earthsong-light.js (Light variant).

To set the earthsong.js theme file on Hyper terminal, set the rainglow parameter to earthsong (without the .js extension) as you can see in the screenshot below.

The same way, to set the earthsong-light.js theme, set rainglow parameter to earthsong-light as you can see in the screenshot below.

To set the earthsong-contrast.js theme, set rainglow parameter to earthsong-contrast as you can see in the screenshot below.

So, that’s how you install Hyper terminal on CentOS 8. Thanks for reading this article.

]]>
Configuring VNC Server on CentOS 8 https://linuxhint.com/vnc_server_centos8/ Sun, 17 Nov 2019 18:15:17 +0000 https://linuxhint.com/?p=50158 In this article, I am going to show you how to configure VNC server on CentOS 8 and use CentOS 8 desktop remotely over the VNC protocol. So, let’s get started.

Allowing VNC Port Through Firewall:

First, you have to allow the VNC port 5900 (default) through the CentOS 8 firewall. To do that, run the following command:

$ sudo firewall-cmd --add-service=vnc-server --permanent

Now, reload firewalld for the changes to take effect with the following command:

$ sudo firewall-cmd --reload

Finding the IP Address:

In order to remotely connect to the CentOS 8 desktop remotely over the VNC protocol, you need to know the IP address of your CentOS 8 machine.

To find the IP address of your CentOS 8 machine, run the following command:

$ nmcli

The IP address of your CentOS 8 machine should be printed. In my case, it’s 192.168.20.131.

Enable Screen Sharing:

You can use the Screen Sharing feature of the GNOME desktop environment of CentOS 8 to easily share your CentOS 8 desktop with other people. So, they can see what you’re doing. But they won’t be able to remotely control your CentOS 8 machine. This is great when you want to show something to someone but you don’t want them to interfere on your work.

To enable Screen Sharing, open the Settings app.

Now, navigate to the Sharing section. Make sure Sharing is turned ON.

Now, click on Screen Sharing.

Toggle ON Screen Sharing.

Screen Sharing should be ON.

Now, from any VNC client, try to connect to your CentOS 8 machine.

Once someone tries to connect to your CentOS 8 machine, you should see a notification as shown in the screenshot below.

Click on the notification and click on Accept to accept the remote connection.

You should be connected to your CentOS 8 machine.

You can also set a password for VNC access. This way, you can access your CentOS 8 machine unattended (no one has to accept the remote connection anymore).

To do that, select Require a password from the Access Options section and type in your desired password.

Now, if you try to connect to your CentOS 8 machine over the VNC protocol, you will be prompted for a password.

If you provide the correct password, you will be able to access your CentOS 8 machine remotely.

Enable Remote Access:

If you want to remotely control your CentOS 8 machine over the VNC protocol, then this section is for you.

To remotely control your CentOS 8 machine, check Allow connections to control the screen from the Screen Sharing window.

You can set a VNC password for unattended access the same way. You also have the option to prompt you for approval for every remote connection.

Now, you can connect to your CentOS 8 machine remotely over the VNC protocol the same way. Once connected, you can remotely control your CentOS 8 machine.

Connect to CentOS 8 Desktop Remotely on Windows 10:

I have used Remmina remote desktop client in the earlier sections of this article for remotely connecting to the CentOS 8 machine over the VNC protocol. Remmina is available on Linux.

If you’re on Mac or Windows, you may probably use RealVNC’s VNC Viewer.

If you try to connect to the CentOS 8 machine using VNC Viewer especially on Windows 10, you will see the following error message.

This happens because, VNC Viewer at the time of this writing, does not support TLS encryption. To fix this, you have to configure CentOS 8 in a way that it allows unencrypted VNC connections. You can use the Dconf Editor app to do that.

You can install Dconf Editor app with the following command:

To confirm the installation, press Y and then press <Enter>.

Dconf Editor should be installed.

Now, start Dconf Editor from the Application Menu of CentOS 8.

Click on I’ll be careful.

Click on org.

Click on gnome.

Click on desktop.

Click on remote-desktop.

Click on vnc.

Click on encryption.

Now, toggle OFF Use default value.

Now, click on the dropdown menu of Custom value. Now, check none and tls-anon checkboxes. Then, click on the tick icon as marked in the screenshot below.

The Current value should be [‘none’,’tls-anon’] as shown in the screenshot below. Now, close Dconf editor.

Now, if you try to connect to your CentOS 8 machine from VNC Viewer, you will see the following warning message. Click on Continue.

Now, type in your VNC password and click on OK.

 

You should be connected to your CentOS 8 machine.

You may face some problems once you’re connected. Such as, you may see a black screen.

You may also see an error message as follows.

It’s easy to fix. To fix this problem, go to the Settings.

Click on Picture quality dropdown menu.

Now, set it to either High, Medium or Low. Then, click on OK.

It should be fixed.

If it’s not fixed yet, close the VNC viewer window.

Now, connect to your CentOS 8 machine from the sessions window.

You should be connected and everything should work as expected.

If you don’t want to go through this hassle, you may use Tight VNC Client. In my testing, Tight VNC Client worked without any problem on Windows 10.

So, that’s how you configure VNC server on CentOS 8. Thanks for reading this article.

]]>