Posts Tagged Under: Linux

Understanding Hard and Soft Links on CentOS/RHEL 7

In windows you’ll have come across shortcuts, e.g. desktop shortcuts. In windows, shortcuts gives you access to the same thing but from a different location. In Linux you can do the same thing, but with a feature called “links”. Links allow users to edit the same file from different locations. There are 2 types of links:

  1. soft links (aka symbolic links)
  2. hard links

Both of these types are links are created using the ln command. To understand how symbolic and hard links differ from one another, you need to first understand inodes:

Hard links

An inode (aka “index node”) is an entry in a filesystem table that reference’s a location in a filesystem. In other words, it’s like a reference book has an index at the back, containing a list of keys along with

Samba – How to set up a Samba client on CentOS/RHEL 7

If you have directories on your machine that you want to share out to other machines then you can do this by setting up your machine as an NFS server. However with NFS you can only share out folders to machine that are in the same private network. If you want share folders to other machines over the public internet, then that’s where you need to use the Samba/CIFS protocol. You can follow along this article using this vagrant project on Github.

We will walk through the following example:

+--------------------------+              +--------------------------+

NFS – Set up private group folders

Let’s say you want to setup group folder that’s available via nfs. However this time only a particulat Linux group is allowed to have read+write access to this folder. You can do this by ensuring the exported folder is owned by a group, and then setup the SGID. You can follow along this article using this vagrant project on Github.

We will walk through the following example:

+--------------------------+              +--------------------------+
|                          |              |      															

NFS – How to set up an NFS client on CentOS/RHEL 7

Network Files System (NFS) is a protocol that let’s one Linux box (NFS server) to share a folder with another Linux box (NFS Client). On the NFS client this shared folder looks like just an ordinary folder. NFS only works in an internal network so you can share folders over the public internet.

This article doesn’t cover how to setup an NFS server, instead we will assume that we already have an NFS server already setup and we want to configure an NFS client to connect to it. We created a NFS vagrant project on github to help you following along with this example. In our example we have:

+--------------------------+              +--------------------------+

RHCE – Make websites more secure by setting up HTTPS and SSL/TLS for CentOS 7

So far we have configured web servers to allow connections via the http protocol. However http is not secure which is why it’s better to use https.

When using https, we actually encrypt all data traffic using Symmetric and Asymmetric Encryption.

To setup the above encryption system on our Apache server, we need to first to install the ssl addon module that will allow Apache to be able to communicate on the SSL/TLS layer:

$ yum install mod_ssl

Next we need to install the software that is used for generating public-private key-pairs, so that we can create a key-pair for our web server.

$ yum install openssl

Next we create the private key and it’s csr file. We generate the private key by running the following:

$ openssl genpkey -algorithm RSA -out -pkeyopt rsa_keygen_bits:2048


System monitoring and reporting using sysstat and dstat on CentOS/RHEL 7

It’s often useful to measure and view various system utilisation metrics, such as for:

  • cpu
  • memory
  • disk
  • network

There are a lot of tools that can measure and collect these metrics, including:

  • dstat – suited for creating realtime reports
  • sysstat – suited for creating historical reports

dstat in action

Dstat shows realtime system utilisation data. First you need to install it:

$ yum install dstat

running dstat on it’s own gives a steady stream of output until you exit out:

[root@target man]# dstat
You did not select any stats, using -cdngy by default.
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw
  0   0 100   0   0   0|  23k   53k|   0  															

RHCSA – About this Course

This course covers everything you need to know in order to pass the Red Hat Certified Systems Administrator (RHCSA) exam for RHEL 7.

Becoming RHCSA certified proves that you have developed a strong proficiency in RHEL. RHEL is short for “RedHat Enterprise Linux” and as the name suggests, it’s a Linux based Operating System. RHEL is not free, and is actually quite expensive, especially if you want to practice using RHEL at home. However there’s a free alternative of RHEL called CentOS.

CentOS is identical to RHEL in nearly every way. The main exception being that the RedHat logo and branding are replaced with CentOS’s own logo and branding. Therefore we will be using CentOS 7 throughout this course, and everything we do will cover/demo will work in exactly the

Real world examples of using firewalld on CentOS/RHEL 7

Previously we gave a brief introduction to firewalld, but we are now going to walk through a few firewalld setups that’s often seen in the real world.

I have created a vagrant project that you can use to follow along in this tutorial. We will use the following demo setup throughout this article:

|                webserver.local                    |
|          +------------------------+               |
|          |  Apache (httpd daemon) |															

Using arp

arp translates ip address to mac addresses.

The arp command let’s you see which one of your interfaces has access to the default gateway, and therefore can access the internet.

the following shows which interface has access to the the default gateway:

$ arp
Address                  HWtype  HWaddress           Flags Mask            Iface             ether   08:00:27:88:f1:e5   C                     enp0s10   															

The DHCP server

A dhcp (dynamic host configuration protocol) server provides configuration to boxes that joins it’s network.

The dhcp often acts as the default gateway too.