Thursday 30 June 2016

Nginx Port already in use

Nginx Port already in use

Starting nginx...nginx: [emerg] bind() to 0.0.0.0:143 failed (98: Address already in use)


If this issue is bothering you never take much worry about that just you have to do simple 2 commands that will give you a solution.

Command 1

netstat -lnp |grep :143

Result

udp        0      0 0.0.0.0:143                 0.0.0.0:*                               1736/portreserve

Command 2

kill -9 1736

Result

Success.


Tuesday 28 June 2016

Linux Booting Process

Hi we are going to see the booting process of linux. I actually wanted to know how it's working still i want to make it to know to every one. Sorry my english will be little bit bad may be more bad. Ok let's look into it.

Linux Booting Process:

Before that we have to know some other things in this that make it PC boot and communicate with OS. I mentioned that files in below. 

Bios - Basic Input/Output System executes MBR
MBR - Master Boot Record Executes GRUB
GRUB - Grand Unified Bootloader executes Kernel
Kernel - Kernel executes /bin/init
Init - Init executes the runlevel programs
Runlevel - Runlevel programs are executed from /etc/rc.d/rc*.d/

BIOS :
  • Bios performs some integrity checks.
  • It searches, loads,and executes the boot loader.
  • BIOS looks for the boot loader file in booting device if it's found then it will loaded into memory and gives the control to it.
  • So it's simple terms of BIOS is load and execute the MBR.
MBR :
  • MBR is stands for Master Boot Record
  • It's located in first sector in the bootable disk. It typically locate in /dev/hda or /dev/sda.
  • MBR is less than 512 bytes in size.
  • It has three components 1. primary boot loader info  in 1st 446 bytes. 2. partition table info in next 64 bytes. 3. mbr validation checks in last 2 bytes.
  • It contains GRUB information. In old systems it contains information about LILO.
GRUB :
  • Grub stand for Grand Unified Bootloader.
  • If we have multi OS installed then it will give a option to choose the options.
  • It's only give us the flash screen that contains to choose the option like bios or boot option or something else..,
  • If we didn't select anything then it will load the default kernel image that specified in the grub.
  • It has the knowledge of the filesystem. but older LILO doesn't have that.
  • It located in /boot/grub/grub.conf and /etc/grub.conf is link to this. Below i mentioned the sample Grub conf.
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-194.el5PAE)
          root (hd0,0)
          kernel /boot/vmlinuz-2.6.18-194.el5PAE ro root=LABEL=/
          initrd /boot/initrd-2.6.18-194.el5PAE.img

  • you can notice baove that have the info about kernel and init image.
Kernel :

  • Kernel mount the root file system as specified in the "root=" in grub.conf
  • Kernel executes the /sbin/init program. initrd stands for initial RAM Disk.
  • Kernel uses the initrd as temporary root file system until kernel boot and the real root file system mounts.
  • It's also contains necessary drivers compiled inside. Which it helps as to access the hard drive and other hardware in PC.
Init :

In linux we have 6 runlevels it located in /etc/inittab. Below linux runlevels are mentioned.
  • init0 - Shutdown - /etc/rc.d/rc0.d/
  • init1 - Single User mode - /etc/rc.d/rc1.d/
  • init2 - Multiuser mode, without NFS - /etc/rc.d/rc2.d/
  • init3 - Full Multiuser mode - /etc/rc.d/rc3.d/
  • init4 - Not Used - /etc/rc.d/rc4.d/
  • init5 - GUI - /etc/rc.d/rc5.d/
  • init6 - Reboot - /etc/rc.d/rc6.d/
Init identifies the default runlevles from /etc/inittab and load all the apprpopriate programs. It's depends on your default init level that system will execute the program from above mentioned directories.

Note there is alos symbolic links available for these directories under /etc/rc0.d is linked to /etc/rc.d/rc0.d.

We can also see under the /etc/rc.d/rc*.d/ directories that starts with S and K. S means startup and K means kill the programs when shutdown. Also there is number in next to S and K in program names. Those are the sequence number in which programs should start or killed.

This is also I have taken from another website and i have modified for my own understanding.

Thanks and if you like this follow my link.


Monday 27 June 2016

Unable to change external url in Gitlab

If we need to change our external url in gitlab we have change it in /etc/gitlab/gitlan.rb, and you have to change the external url like below mentioned.
  • cd /etc/gitlab/
  • vim gitlab.rb
in this we have to change the required url like below.

external_url 'https://gitlab.testdomain.com'

Then we have to change yml file location /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml

  • cd /opt/gitlab/embedded/service/gitlab-rails/config/
  • vim gitlab.yml
change the hostname of the external url like below


 ## GitLab settings
  gitlab:
    ## Web server settings (note: host is the FQDN, do not include http://)
    host: gitlab.testdomain.com
    port: 443
    https: true

Finally reconfigure the gitlab with below command and restart for the host name.

  • gitlab-ctl reconfigure
  • gitlab-ctl restart



Friday 24 June 2016

Process Management in RHEL 6

This project introduces some of the basic commands and utilities used to manage process .

Below I have mentioned the most i preferred to manage process.




  • ps
  • top
  • renice
  • kill 
1.PS

We can view the current running process with ps command. I will mention some basic ps useful command.

To see every process on the system using standard syntax:
  • ps -e
  • ps -ef
  • ps -eF
  • ps -ely
To see every process on the system using BSD Syntax:
  • ps ax
  • ps axu
To print a process tree:

  • ps -ejH
  • ps axjf
To get info about threads:
  • ps -eLF
  • ps axms
To get security info:
  • ps -eo euser,ruser,suser,fuser,f,comm,label
  • ps axZ
  • ps -eM
To see every process running as root (real & effective ID) in user format:
  • ps -U root -u root u
To see every process with a user-defined format:
  • ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm
  • ps axo stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm
  • ps -eopid,tt,user,fname,tmout,f,wchan
Print only the process IDs of syslogd:
  • ps -C syslogd -o pid=
Print only the name of PID 42:
  • ps -p 42 -o comm=
If there are a lot of processes on the system, you will probably want to page through or limit them using one of the filtering options, or the grep command.

Shows a page at a time:
  • ps -ef | more
Returns only those lines containing the string "java"
  • ps -ef | grep java
Returns only those lines containing the string "java", with a case-insensitive search.
  • ps -ef | grep -i java
Returns only those lines containing the string "ora", omitting the grep line using "grep -v".
  • ps -ef | grep java | grep -v grep
Returns only those lines containing the string "java", omitting the grep line using a regular expression.
  • ps -ef | grep [j]ava
2.TOP

The top command is probably the most well know utility for displaying the most resource intensive processes on the system. For the most part you can get away with just running top and looking at the output.
  • top
top - 17:14:40 up  6:49,  1 user,  load average: 0.00, 0.00, 0.00
Tasks: 104 total,   1 running, 103 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.1%us,  0.1%sy,  0.0%ni, 99.6%id,  0.2%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   2050836k total,   459132k used,  1591704k free,    44956k buffers
Swap:  4128760k total,        0k used,  4128760k free,   163880k cached

  PID USER      PR  NI  VIRT  RES  SHR  S %CPU %MEM    TIME+     COMMAND           
 3414 root      20  0  15084  1088 824  R  2.0  0.1    0:00.01    top                 1   root      20  0  19396  1500 1192 S  0.0  0.1    0:00.71    init             
  2   root      20  0    0      0   0   S  0.0  0.0    0:00.00    kthreadd         
  3   root      RT  0    0      0   0   S  0.0  0.0    0:00.00    migration/0        

If you want to add or remove columns from the display, press the "f" key and toggle the letters in the "Current Fields" string. Capital letters mean the column is displayed. When you are satisfied press the return key and you will see the displayed columns will have changed.


Current Fields:  NAEHIOQTWKMbcdfgjplrsuvyzX  for window 1:Def
Toggle fields via field letter, type any other key to return 

* N: %MEM       = Memory usage (RES)
* A: PID        = Process Id
* E: USER       = User Name
* H: PR         = Priority
* I: NI         = Nice value
* O: VIRT       = Virtual Image (kb)
* Q: RES        = Resident size (kb)
* T: SHR        = Shared Mem size (kb)
* W: S          = Process Status
* K: %CPU       = CPU usage
* M: TIME+      = CPU Time, hundredths
  b: PPID       = Parent Process Pid
  c: RUSER      = Real user name
...

To alter the order of the columns displayed, press the "o" key and use the 
upper case and lower case letters corresponding to each column to move 
then left and right of the "Current Fields" string.

The sorting of the data can be altered using the following keys:

    M : Sort by %MEM column.
    N : Sort by PID column.
    P : Sort by %CPU column.
    T : Sort by TIME+ column.
    < : Moves the sort column left.
    > : Moves the sort column right.

The "r" and "k" keys are used to renice and kill sessions. 
These commands will be discussed below.

People often get a little confused about the memory information summary 
in the top part of the screen because the free memory listed seems very 
low to them. Linux uses free physical memory for the file system cache 
to improve I/O performance. If more memory is needed for processes, it 
is released from the file system cache. Linux only starts to use swap 
when all physical memory has been used. So the actual free memory on the
system is free+buffers+cached. If your concern is free memory, it is 
easier to use the free command to monitor it. The "Mem:" 
line gives the values presented by top, while the "-/+ buffers/cache:"
line gives the memory used by processes, ignoring the file system cache.
  • free
total used free shared buffers cached
Mem:       2050836     459248    1591588          0      44988     163880
-/+ buffers/cache:     250380    1800456
Swap:      4128760          0    4128760
#

3.Renice

The renice command is used to alter the scheduling priority of one or more processes.
The "-h" flag displays the cut down usage notes.
  • renice -h
Usage:
 renice [-n] priority [-p|--pid] pid  [... pid]
 renice [-n] priority  -g|--pgrp pgrp [... pgrp]
 renice [-n] priority  -u|--user user [... user]
 renice  -h | --help
 renice  -v | --version

#

The priority can be changed to an absolute value or a value relative to 
the current setting. The following example changes the priority of the 
process with the PID of 8 to the value 10, then adds 1 to the priority.
  • renice 10 8
8: old priority 0, new priority 10
  • renice +1 8
8: old priority 10, new priority 11

With no flags set, it is assumed you are using "renice -n priority -p 
pid", so you are only targeting processes by the pid. The following are equivalent.
  • renice -n +1 -p 8 9
  • renice +1 8 9
You can also target multiple processes based on their group or user
  • renice -n +1 -g 500
  • renice -n +1 -u oracle
You can also combine flags to target more processes.
Before you start altering the priorities you need to understand the inter-dependencies between processes. It is possible that by slowing down one process you will adversely affect the performance of other processes that depend on it.
The renice command can also be performed interactively in the top command, or from the "System Monitor" GUI.

4.kill

Not surprisingly, the kill command is used to kill
processes. Assuming we have identified a process we want to kill and it has a process id of "1234", we may use one of the two common forms are show below.
  • kill 1234
  • kill -9 1234
The first example sends the "TERM" signal to the specified process, which is the preferred option. The second is more aggressive, sending the "KILL" signal. You should only use the "KILL" signal if your attempts to kill the process with the "TERM" signal have failed.
Always make sure to double check the process you are killing. Killing the wrong process can cause the system to crash.
The kill command can also be performed interactively in the top command, or from the "System Monitor" GUI.
You can kill multiple processes using a single command by combining kill with the ps and awk commands.
  • kill -9 `ps -ef | grep ora | awk '{print $2}'`

Wednesday 22 June 2016

Install PolicyD on Zimbra 8.5



What is Policyd?

Policyd is an anti spam plugin. Policyd have some module like quotas, access control, spf check, greylisting and others.
Zimbra Collaboration Suite is an email server who use Postfix as engine for MTA. By default, policyd have been bundled with Zimbra from Zimbra version 7.

Why we must use Policyd?

Policyd have module quotas. This module can use for limit sending/receipt email. As example just allow sending/receipt email 200 emails/hours/users. If your email server attacked by spam or compromised password some users and used by spammer, the maximum email can be sent as many as 200 emails per hour. This policy will safe your IP public from blacklist on RBL. Besides, you can check who user send email with many email

How To Install Policyd on Zimbra 8.5?

This guidance is step by step how to install policyd on Zimbra 8.5.
Activate Policyd


#su - zimbra
#zmprov ms `zmhostname` +zimbraServiceInstalled cbpolicyd +zimbraServiceEnabled cbpolicyd 
 
Activate Policyd WebUI

Run the following command as root
 
#cd /opt/zimbra/httpd/htdocs/ && ln -s ../../cbpolicyd/share/webui 
 
Edit file /opt/zimbra/cbpolicyd/share/webui/includes/config.php and 
putting “#” on front of all the lines beginning with $DB_DSN and adding 
the following line just before the line beginning with $DB_USER
 
$DB_DSN="sqlite:/opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb"; 
 
See the following example
 
#$DB_DSN="mysql:host=localhost;dbname=cluebringer";
$DB_DSN="sqlite:/opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb";
$DB_USER="root";
 
Restart Zimbra service  and Zimbra Apache service
 
#su - zimbra -c "zmcontrol restart"
#su - zimbra -c "zmapachectl restart"
  

LDAP Authentication in Gitlab

LDAP:

GitLab integrates with LDAP to support user authentication. This integration works with most LDAP-compliant directory servers, including Microsoft Active Directory, Apple Open Directory, Open LDAP, and 389 Server. GitLab EE includes enhanced integration, including group membership syncing.

Security:

GitLab assumes that LDAP users are not able to change their LDAP 'mail', 'email' or 'userPrincipalName' attribute. An LDAP user who is allowed to change their email on the LDAP server can potentially take over any account on your GitLab server.

We recommend against using LDAP integration if your LDAP users are allowed to change their 'mail', 'email' or 'userPrincipalName' attribute on the LDAP server.


Configuration:

Before this you have add the AD hostname to the host entry. So it will communicate without any trouble. 

Create one user in AD for Ldap authentication.

Simply we can configure this through this following file /etc/gitlab/gitlab.rb

Need to open /etc/gitlab/gitlab.rb file with your favorite editor. Then follow the steps below.

 gitlab_rails['ldap_enabled'] = true
 gitlab_rails['ldap_servers'] = YAML.load <<-'EOS' # remember to close this block with 'EOS' below
   main: # 'main' is the GitLab 'provider ID' of this LDAP server
     label: 'LDAP'
     host: 'testserver.com'
     port: 389
     uid: 'sAMAccountName'
     method: 'plain' # "tls" or "ssl" or "plain"
     bind_dn: 'CN=git,DC=testserver,DC=com'
     password: '**************'
     active_directory: true
     allow_username_or_email_login: false
     block_auto_created_users: false
     base: 'DC=testserver,DC=Com'
     user_filter: ''
     attributes:
     username: ['uid', 'userid', 'sAMAccountName']
     email:    ['mail', 'email', 'userPrincipalName']
     name:       'cn'
     first_name: 'givenName'
     last_name:  'sn'
     ## EE only
     group_base: 'OU=GitG,DC=testserver,DC=com' - optional
     admin_group: 'administrators' - optional
     sync_ssh_keys: false
EOS



Self_Signed Certificate Generate for GitLab



1. Create Private Key

  # openssl genrsa -des3 -out /etc/gitlab/ssl/gitlab.domain.com.key 2048
      

2. Create Certificate Request

# openssl req -nodes -newkey rsa:2048 -keyout gitlab.domain.com.key -out gitlab.domain.com.csr


    Enter Country Name US
    Enter State or Province Full Name
    Enter City Name
    Enter Organization Name
    Enter Company Name
    Enter Organizational Unit Name
    Enter server hostname i.e. URL gitlab.domain.com
    Enter Admin Email Address
    Skip Challenge Password (Hit Enter)
    Skip Optional Company Name (Hit Enter)


3. Remove Pass Phrase from Private Key

     # cp -v /etc/gitlab/ssl/gitlab.domain.com.{key,original}

    # openssl rsa -in /etc/gitlab/ssl/gitlab.domain.com.original -out /etc/gitlab/ssl/gitlab.domain.com.key

   # rm -v /etc/gitlab/ssl/gitlab.domain.com.original

4. Create Certificate 
  
   # openssl x509 -req -days 1460 -in /etc/gitlab/ssl/gitlab.domain.com.csr -signkey /etc/gitlab/ssl/gitlab.domain.com.key -out /etc/gitlab/ssl/gitlab.domain.com.crt

5. Remove Certificate Request File 


# rm -v /etc/gitlab/ssl/gitlab.domain.com.csr

6. Set file permissions 

  #  chmod 600 /etc/gitlab/ssl/gitlab.domain.com.*

Wednesday 15 June 2016

GitLab Installation RHEL 6 & 7

1. Install and configure the necessary dependencies 

If you install Postfix to send email please select 'Internet Site' during setup. Instead of using Postfix you can also use Sendmail or configure a custom SMTP server and configure it as an SMTP server.

On Centos 6 and 7, the commands below will also open HTTP and SSH access in the system firewall.

# yum install curl openssh-server openssh-clients postfix cronie
# service postfix start
# chkconfig postfix on
# lokkit -s http -s ssh
 
 

2. Add the GitLab package server and install the package 

# curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
# yum install gitlab-ce
 
# curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash 

3. Configure and start GitLab 

# gitlab-ctl reconfigure
 

4. Browse to the hostname and login 

On your first visit, you'll be redirected to a password reset screen to provide the password for the initial administrator account. Enter your desired password and you'll be redirected back to the login screen.

The default account's username is root. Provide the password you created earlier and login. After login you can change the username if you wish.

 

 

 

 

Tuesday 7 June 2016

Zimbra Installation Method


Domain     : test.net
Hostname   : mail
IP Address : 192.168.80.91
Gateway    : 192.168.80.11 
 
vim /etc/sysconfig/network-scripts/ifcfg-eth0 
 
DEVICE=eth0
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=192.168.0.1
NETMASK=255.255.255.0
DNS1=192.168.0.1
GATEWAY=192.168.0.11
DNS2=192.168.0.11
DNS3=8.8.8.8
USERCTL=no
 
#service network restart
#chkconfig network on
 
 
Open file /etc/sysconfig/selinux and change SELINUX=enforcing become SELINUX=disabled
Also disable some service such as iptables and ip6tables.   
 
setenforce 0
service iptables stop
service ip6tables stop
chkconfig iptables off
chkconfig ip6tables off 
 
Open file /etc/hosts and configure as follows
 
127.0.0.1     localhost
192.168.80.91 mail.test.net mail
 
Open file /etc/resolv.conf and configure as follows
 
search test.net
nameserver 192.168.80.91
nameserver 192.168.80.11
nameserver 8.8.8.8
 
Do the following command as root and open file /etc/sysconfig/network 
to change hostname to the name mail.imanudin.net 
 
 
 

hostname mail.imanudin.net
 
#vi /etc/sysconfig/network 
 
NETWORKING=yes
HOSTNAME=mail.test.net
 
#service sendmail stop
#service postfix stop
#chkconfig sendmail off
#chkconfig postfix off 
 
#yum update
#yum -y install perl perl-core wget screen w3m elinks openssh-clients openssh-server bind bind-utils unzip nmap sed nc sysstat libaio rsync telnet aspell 

Configure local DNS Server :

Zimbra needed lookup to MX records on domain that used. For that purpose, we can configure dns server on the same machine with Zimbra mail server
Open file /etc/named.conf and add any on listen-on port 53 and allow-query as follows

listen-on port 53 { 127.0.0.1; any; };
allow-query     { localhost; any; };
 
Create a zone at the bottom of file named.conf as follows
 
zone "test.net" IN {
type master;
file "db.test.net";
allow-update { none; };
};
 
Create database for a new zone who has been created in folder /var/named/
 
#touch /var/named/db.test.net
#chgrp named /var/named/db.test.net
#vi /var/named/db.test.net 
 
fill as follows
 
$TTL 1D
@       IN SOA  ns1.test.net. root.test.net. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
@       IN      NS      ns1.test.net.
@       IN      MX      0 mail.test.net.
ns1     IN      A       192.168.0.91
mail    IN      A       192.168.0.91
 
#service named restart
#chkconfig named on
#nslookup mail.test.net
#dig test.net mx 
 
After previously preparation for install Zimbra has been finished
we can install Zimbra right now. First, we can download Zimbra 
Binary from this link http://www.zimbra.com/downloads/zimbra-collaboration-open-source or 
if you are in Indonesia region,you can download at the following link http://mirror.linux.or.id/zimbra/binary/

 
#cd /opt/
#wget -c https://files.zimbra.com/downloads/8.6.0_GA/zcs-8.6.0_GA_1153.RHEL6_64.20141215151155.tgz 
 
After finished download, extract Zimbra, move into folder result of extract and install Zimbra
 
#tar -zxvf zcs-8.6.0_GA_1153.RHEL6_64.20141215151155.tgz
#cd zcs-8.6.0_GA_1153.RHEL6_64.20141215151155
#sh install.sh 
 
type Y if asking license agreement
 
Do you agree with the terms of the software license agreement? [N] Y
 
Select the packages that will be installed
 
Install zimbra-ldap [Y] Y
Install zimbra-logger [Y] Y
Install zimbra-mta [Y] Y
Install zimbra-dnscache [Y] N
Install zimbra-snmp [Y] Y
Install zimbra-store [Y] Y
Install zimbra-apache [Y] Y
Install zimbra-spell [Y] Y
Install zimbra-memcached [Y] Y
Install zimbra-proxy [Y] Y - if your using for public, otherwise give N
 
Type Y if asked The system will be modified.  Continue?
if you get message like below, press enter or type Yes and change domain name

DNS ERROR resolving MX for mail.test.net
It is suggested that the domain name have an MX record configured in DNS
Change domain name? [Yes] Yes
Create domain: [mail.test.net] test.net
 
if you not change domain name on above section, your domain name will become mail.test.net 
and email of account will become user@mail.test.net
Type 6 and then press key enter to change password of admin account and type again 4 and 
then press key enter. Insert your password that you want 

1) Common Configuration:                                                  
   2) zimbra-ldap:                             Enabled                       
   3) zimbra-logger:                           Enabled                       
   4) zimbra-mta:                              Enabled                       
   5) zimbra-snmp:                             Enabled                       
   6) zimbra-store:                            Enabled                       
        +Create Admin User:                    yes                           
        +Admin user to create:                 admin@test.net            
******* +Admin Password                        UNSET                         
        +Anti-virus quarantine user:           virus-quarantine.dgnsq8ewc@test.net
......
......
Address unconfigured (**) items  (? - help) 6
Store configuration

   1) Status:                                  Enabled                       
   2) Create Admin User:                       yes                           
   3) Admin user to create:                    admin@test.net            
** 4) Admin Password                           UNSET                         
   5) Anti-virus quarantine user:              virus-quarantine.dgnsq8ewc@test.net
......
......
Select, or 'r' for previous menu [r] 4

Password for admin@test.net (min 6 characters): [s8eNUeOms] Verys3cr3t
 
After insert password, Select, or ‘r’ for previous menu. If all has been
 configured, apply configuration and wait a moment until zimbra finished
 install
 
*** CONFIGURATION COMPLETE - press 'a' to apply
Select from menu, or press 'a' to apply config (? - help) a
Save configuration data to a file? [Yes] Yes
Save config in file: [/opt/zimbra/config.24648] 
Saving config in /opt/zimbra/config.24648...done.
The system will be modified - continue? [No] Yes
Operations logged to /tmp/zmsetup10052014-214606.log
 
Type Yes if asked Notify Zimbra of your installation? 
and if has been appeared Configuration complete – press return to exit
your zimbra installation has been finished.
Check Zimbra status with this command su – zimbra -c “zmcontrol status” 
and make sure all service running well. 
You can also trying access webmail via browser at url https://ZimbraServer 



  
 
 

Permanent hostname setup for RHEL7

Step 1 Set the host name on NMTUI tool like following nmtui set host name   then save and exit Step 2 add the following l...