centos

How to Configure Time Server (NTP Server) on Centos 7?

Prerequisites:

VM/ Physical – It is recommended to have the time server as a physical server, but VMs should be okay depending on your setup and requirement. My virtual lab environment is VMware based so here’s the guide for a VM. Once the CentOS Minimal is installed on the VM make sure to install open-vm-tools.

If you are not conformable with Vi Editor please use install nano for editing.

Installing the time server:

  1. First we need to install NTPd . to do this open command line :

  2. Then open NTP main configuration file for editing:
    If you are planning on hosting your time servers externally like time01.yourdomain.com, time02.yourdomain.com with ports 123 open on the firewall. Each of the time server will be talking to 0.us.pool.ntp.org, 0.us.pool.ntp.org, 0.us.pool.ntp.org, 0.us.pool.ntp.org. Later on you can probably add your time servers to the NTP.org by joining the pool. For my example, I am not using the centos default pool, but i am using the U.S. zone. For internal servers/workstations you can point it to the local ip/dns name for the local time servers.

  3. Then start and enable ntp server:

  4. You need to allow ntp service on firewall(NTP service uses UDP port 123). So run next command:

  5. Verify you ntp service with next command:

Your output should be similar to:

Linux: CentOS 6 kernel panic+0xa7/0x16f fix

So ran into a view issue for a Linux Host today. Kernel Panic !!!

There could be a number of reasons that you might get this error. The three common reasons may be:

  1. There was a change to selinux config – (that might be an error in the config file)
  2. There are disk errors
  3. The kernel is corrupted

None of the kernels in the GRUB boot menu will boot, you get a kernel panic:

1-kernel-panic

Kernel panic – not syncing: Attempted to kill init!
Pid: 1, comm: init Not tainted 2.6.32-504.3.3.el6.x86_64 #1
panic+0xa7/0x16f
do_exit+0x862/0x870
fput+0x25/0x30
do_group_exit+0x58/0xd0
sys_exit_group+0x17/0x20
system_call_fastpath+0x16/0x1b

Booting in single user mode doesn’t work either.

Here’s how to fix this:

            1. Reboot, and go in the GRUB menu. You have 3 seconds to strike the arrow keys before it will automatically boot the default kernel.2-grub-menu
            2. Select the first line, the default kernel, and press the E key on the keyboard to edit the parameters. You will then see the following.
              3-grub-edit
            3. Use the arrow keys to select the 2nd line, that starts with kernel. Press the E key to change this line, use the arrow keys to go to the end and type a space followed by enforcing=0
              4-grub-edit
            4. Press enter to conform and then press B to boot the system.
              It should boot up fine now.
            5. Choose your solution:

              SELINUX Config FileDisk ErrorsRebuild Kernel

              Disabled for the SELINUXTYPE variable, that’s wrong it has to be for the SELINUX variable. In the screenshot below I show you the correct settings in the config file to disable SELINUX.

              5-selinux-disabled

            6. Reboot.

“Host SMBus controller not enabled!”

CentOS guest instances in VMware sometimes come up with the boot error message:

This error is being caused because VMware doesn’t actually provide that level interface for CPU access, but Ubuntu try to load the kernel module anyway.

How to fix it:

add the line:

Reboot.

NOTE: for older versions use blacklist i2c_piix4 instead.
NOTE: it works both in VMWare Fusion 5 and 6, and Ubuntu LTS 12.04 and 14.04

How to Start and Enable Firewalld on CentOS 7

It is highly recommended that you have a firewall protecting your server.

Pre-Flight Check

  • These instructions are intended specifically for enabling and starting firewalld CentOS 7.
  • I’ll be working from a Liquid Web Self Managed CentOS 7 server, and I’ll be logged in as root.

Check the Status of Firewalld

To check the status of firewalld, run the following command as root:

Enable Firewalld

To enable firewalld, run the following command as root:

Start Firewalld

To start firewalld, run the following command as root:

How to setup network after RHEL/CentOS 7 minimal installation

After installing RHEL/CentOS 7 minimal, You may not able to connect network in that machine. This will happen because Ethernet interfaces are not enabled by default.
This guide explain you to setup network on RHEL/CentOS 7.

Setup network on CentOS 7 minimal

First, type “nmcli d” command in your terminal for quick list ethernet card installed on your machine:

CentOS_7-network-setup

“nmcli d” command output

Type “nmtui” command in your terminal to open Network manager. After opening Network manager chose “Edit connection” and press Enter (Use TAB button for choosing options).

CentOS_7-Network-manager-screen

CentOS_7 Network manager screen

Now choose you network interfaces and click “Edit

Edit-your-network-interfaces

 

Edit your network interfaces

DHCP configuration

Choose “Automatic” in IPv4 CONFIGURATION and check Automatically connect check box and press OK and quit from Network manager.

Set-ip-adress-using-DHCP

Set ip adress using DHCP

Reset network services:

Now your server will get IP Address from DHCP .

CentOS-7-check-ip-address

CentOS 7 check ip address.