Install Docker and Learn Basic Container Manipulation in CentOS and RHEL 8/7

Docker is a set of platform as a service (PaaS) products that use OS-level virtualization to deliver software in packages called containers.

 To install the latest version of the Docker Engine you need to set up the Docker repository and install the yum-utils package to enable Docker stable repository on the system.

# yum install -y yum-utils
# yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo


Now install the newer docker-ce version from the Docker repository and containerd manually, because due to some issues, Red Hat blocked the installation of containerd.io > 1.2.0-3.el7, which is a dependency of docker-ce.

# yum install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
# yum install docker-ce docker-ce-cli

After, Docker package has been installed, start the daemon, check its status and enable it system-wide using the below commands:

# systemctl start docker 
# systemctl status docker
# systemctl enable docker

Finally, run a container test image to verify if Docker works properly, by issuing the following command:

# docker run hello-world


Docker commands
=====================
# yum install -y yum-utils

# yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

# yum install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm

# yum install docker-ce docker-ce-cli
# systemctl start docker 
# systemctl status docker
# systemctl enable docker
# docker run hello-world  >>>>>>>Test 
# docker info
# docker version
# docker  >>>> help
# docker search ubuntu  >>> search containers
#docker pull ubuntu  >>> its available in hub.docker.com
#docker images
# docker rm ubuntu  >>> remove image
#docker rename tecmint-web ami-web  >>> renaming
# docker run ubuntu cat /etc/issue 
# docker ps -l 
#docker ps -a  >>>> for seeing all containers 
#docker start/stop/stats ami-web
# docker run --name ubuntu20.04 ubuntu cat /etc/issue
# docker run -it ubuntu bash

# sudo docker run -dit --name ami-web -p 8080:80 -v /home/user/website/:/usr/local/apache2/htdocs/ httpd:2.4  >>> for apached web

# vi /home/user/website/docker.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Apache from Docker </title>
</head>
<body>
    <h1>Its from Docker Apache</h1>   
</body>
</html>
#exit

Open LDAP importing certificate and mapping user`s home directory in redhat7

The OpenLDAP logo

LDAP is a platform-independent protocol. Several common Linux distributions include OpenLDAP Software for LDAP support. The software also runs on BSD-variants, as well as AIX, Android, HP-UX, macOS, Solaris, Microsoft Windows (NT and derivatives, e.g. 2000, XP, Vista, Windows 7, etc.), and z/OS.

We have an open LDAP server :

First we need to check ldap package is installed or not in the LDAP server

#rpm -qa | grep openldap

#rpm -qa | grep nfs*

Here we created some users in home/guests

Next step go to Client server system or desktop system

configure static IP add LDAP server IP in /etc/hosts

Ping with the LDAP server IP

install yum install -y sssd*

The System Security Services Daemon is a software package originally developed for the Linux operating system that provides a set of daemons to manage access to remote directories and authentication mechanisms.

install authconfig*
the authconfig-tui command being deprecated (tui stands for Text User Interface), the only remaining options are the system-config-authentication and authconfig commands. One is a graphical command, this other a text one.

#yum install authconfig*

#authconfig-gtk in GNOME terminal
note: in TUI #authconfig-tui

check the URL certificate link :

Then check in /etc/openldap/cacerts/

you can see that .pem file

Restart sssd service

#systemctl restart sssd

Verification :

#getent passwd <username> here am using the user ldapuser0

or

#id ldapuser0

If you can see the userid details then you configured ldap certificate successfully.

Other wise you may check the URL link and the LDAP server URL name whether its correct or not .

You can check with ssh localhost also ;

Now you can check with the user with ldapuser0@localhost or su – ldapuser0

You can log in but you must get permission denied error .That we can fix with autofs configuration .

Mapping User`s home directory

#yum install -y autofs*

check the installed package

create a map file under # vi /etc/auto.ami (anyname you can give )

add the line

ldapuser0 -rw classroom.example.com:/home/guests/ldapuser0

Above command and URL should be corrected

Then save and quit

here i wanted ldapuser0 home directory should mount when log in to the server :

then add this in to auto.master file:

#systemctl restart autofs

#su – ldapuser0

For adding all other users by default read and write

ldapuser0 -fstype=auto classroom.example.com:/home/guests/ldapuser0 (for individual user)

* -fstype= auto classroom.example.com:/home/guests/& (for all the users)

If we are adding this entry all the users can get read and write ie won`t get permission denied error

Only single user home directory mount this will be the output : here ldapuser1 entry added so users can read and write :

Below example all the ldap users can able to read and write :

If you are getting error like mkdir: warning cannot create directory ‘home/guests’: permission denied then try

authconfig --enablemkhomedir --update

Thats it ……

Reset Root Passwords on RHEL 7 and CentOS 7 Linux Systems

Grub2

Select e for edit

come to the line linu16 end UTF-8 type rd.break

then ctrl + x

2

 

switch_root:/# mount -o remount,rw /sysroot
switch_root:/# chroot /sysroot

sh-4.2# echo “New-root-password” | passwd --stdin root

or 
#passwd root
#passwd 
sh-4.2# touch /.autorelabel (Note :relabel spelling is important)

# exit
# exit

restarted the system

Ticketing tools

Many ITIL based ticketing tools are avail in the market .These are among popular using

 

Service Now

Achieve end to end transformation for your IT services and infrastructure through a single cloud based platform. ServiceNow® IT Service Management (ITSM) lets you consolidate fragmented tools and legacy systems while automating service management processes. It’s simple to configure and fast to deploy, so you can go live quickly with confidence, while scaling to your business needs.

 

IBM SCCD Tool:

SCCD (SmartCloud Control Desk) Now IBM Control Desk

Benefits

IBM Control Desk features innovative, industry-leading functionality in many areas, including:

  • A simple, easy-to-use service catalog and self service interface
  • Tools for easily reporting problems and requesting services
  • Applications that enable IT staff to be productive and responsive in prioritizing, tracking, and resolving end-user issues
  • ITIL-aligned change, configuration, release, incident, problem, and asset management
  • Integrated service, asset, and configuration management
  • Built-in integrations with IBM and third-party applications
  • Policy-based automation of job plans, task assignments, notifications, and workflows to reduce labor costs
  • Advanced analytics tools that provide insight into your environment and help you manage change more efficiently

 

 

 BMC Remedy

People-centric user experiences help you to work smarter

  • Stunning reports and visualizations allow intuitive exploration of data
  • Native mobile apps let you use the full power of Remedy 9 anywhere
  • Embedded ITIL v3 processes, with industry best practice reports and KPIs available out-of-the-box
  • Develop your own apps with Innovation Suite, a rich portfolio of intuitive drag-and-drop designers and tools
  • Multi-Cloud Service Management provides a seamless service experience across multi-cloud environments

 

 

Installing ESXi 5.5 on VMware Workstation 11

Requirements:

i3 Processor(Virtualiastion Technology enabled from BIOS)or above with minimum 8GB of RAM.

Install VMware worksation 11 .

First step is to register on VMware portal and download vSphere Hypervizor (ESXi) – current version when that article is written  version is ESxi5.5. Once you register and download software VMware will issue serial number for ESXi as this software is available for free with limited number of features – for details check article on VMware web page “VMware vSphere Architectures Compared“.

 

 

 

 

Next>>

Select default settings my case 2 processor 1 core and 4 GB RAM

 

 

 

 

 

 

 

After that download the vsphere from the web link .

 

 

 

Enable SSH

First log into the ESXi console, bring up the logon box by pressing the <F2> button.

VMware vSphere How to enable SSH

At the “Authentication Required” logon window enter your login username and password, then press the <Enter> key to continue.

VMware ESXi 5.1 Enable SSH

From the “System Customization” screen scroll down to “Troubleshooting Options” and press the <Enter> key.

VMware vSphere 5.1 Enable SSH

You’ll now see four options under the “Troubleshooting Mode Options” menu, from here you toggle between enabling and disabling the “ESXi Shell” and/or “SSH”.  By highlighting the relevant option and pressing the <Enter> key you can toggle between enabling and disabling that part particular option.

As you can see from the screenshot below, if the option giving you the option to “Enable” it then that means that the setting is currently disabled.

Enable SSH vSphere

In this example I want to enable SSH on the ESXi 5.x host so I highlight the relevant line and then press the <Enter> key.

Disable SSH vSphere ESXi

 

 

 

Printer Migration between 2008 and 2012

To manage the migration process, use one of the following:

  • The Printer Migration Wizard, which you access through Print Management, a snap-in in Microsoft Management Console (MMC).
  • The Printbrm.exe command-line tool. or Printmig.exe

Before you can start the migration process, you must ensure the Print and Document Services role is installed on the destination server (PRNT-SRV in our case).

1- Backup the source server (our 2008 R2 server) using the Printer Migration Wizard

From our Windows Server 2012 we will use the Print Management console to perform the Migration.

1- Open Server Manager, click Tools, and then click Print Management.

2- Right Click Print Management, and select Migrate Printer

3- Select “Export printer queues and printer drivers to a file”  and click Next

 

4- Provide the Server name from which you want to extract to printer queues and drivers. and click next.

 

5- Review the list and click Next

 

6- Provide a location and a file name to save the extracted data and click Next

 

7- When the export is complete click Finish.

2- Restore printers to the destination server (PRNT-SRV) using the Printer Migration Wizard

1- Right-click Print Management, and then click Migrate Printers to open the Printer Migration Wizard. Select Import printer queues and printer drivers from a file, and then click Next

After selecting the file we created when we exported the Print Queues and drivers, click Next

 

2- Review the printers to be imported and click Next.

3- Select “This Print Server (\\PRNT-SRV)” if you are running the Print Management console from the target server, or select the appropriate server in your domain by selecting “A print server on the network”

 

4- Set the import options and click Next

Wen the wizard completes, ensure that you do not have any errors, test the printers,

  • View event log messages about the migration.
  • Manually check the destination server for each printer migrated from the source server.
  • Verify that the printer associated with each printer queue is online
  • Confirm that a printer queue’s special settings, permissions, or drivers were preserved during the migration
  • Check the properties for each queue on the destination server and verify that any special settings are still applicable.
  • If the driver installs any non-standard settings that have been altered as a result of the migration, verify those as well
  • Make any necessary changes, such as adding a port monitor or a new driver

If you are using Active Directory Domain Services (AD DS) to publish printers, do not publish printers to AD  when you restore printers. This prevents duplicate printers from being displayed by AD DS before the destination server configuration is verified.

On the source server, you must unpublish printers before renaming the source server. To do this, select all printers in the Print Management snap-in, right-click the selected printers, and then click Remove from Directory. This prevents printers from being published twice to AD when the source server is renamed.

After renaming the destination server to the source server’s original name, you can publish all printers on the destination server to AD DS. To do this, select all printers in the Print Management snap-in, right-click the selected printers, and then click List in directory.

 

Export the DHCP database from a server that is running Microsoft Windows Server 2003 or Windows Server 2008

To move a DHCP database and configuration from a server that is running Windows Server 2003 or Windows Server 2008 to another server that is running Windows Server 2008:

1.   Log on to the source DHCP server by using an account that is a member of the local Administrators group.

2.   Click Start, click Run, type cmd in the Open box, and then click OK.

3.   Type netsh dhcp server export C:dhcp.txt all , and then press ENTER.

Note: You must have local administrator permissions to export the data.

Configure the DHCP server service on the server that is running Windows Server 2008

1.   Click Start, click Administrative Tools, click Server Manager. If needed acknowledge User Account Control.

2.   In Roles Summary click Add Roles, click Next, check DHCP server, and then click Next.

Import the DHCP database

1.   Log on as a user who is an explicit member of the local Administrators group. A user account in a group that is a member of the local Administrators group will not work. If a local Administrators account does not exist for the domain controller, restart the computer in Directory Services Restore Mode, and use the administrator account to import the database as described later in this section.

2.   Copy the exported DHCP database file to the local hard disk of the Windows Server 2008-based computer.

3.   Verify that the DHCP service is started on the Windows Server 2008-based computer.

4.   Click Start, click Run, type cmd in the Open box, and then click OK.

5.   At the command prompt, type netsh dhcp server import c:dhcpdatabase.txt all , and then press ENTER, where c:dhcpdatabase.txt is the full path and file name of the database file that you copied to the server.

Note When you try to export a DHCP database from a Windows 2000/2003 domain controller to a Windows Server 2008 member server of the domain, you may receive the following error message:

Error initializing and reading the service configuration – Access Denied

Note You must have local administrator permissions to import the data.

6.   To resolve this issue, add the Windows Server 2008 DHCP server computer to the DHCP Admins group at the Enterprise level and redo steps 4 & 5.

7.   If the “access is denied” error message occurs after you add the Windows Server 2008 DCHP server computer to the DHCP Admins group at the Enterprise level that is mentioned in step 6, verify that the user account that is currently used to import belongs to the local Administrators group. If the account does not belong to this group, add the account to that group, or log on as a local administrator to complete the import and redo steps 4 & 5.

Authorize the DHCP server

1.   Click Start, point to All Programs, point to Administrative Tools, and then click DHCP.

Note You must be logged on to the server by using an account that is a member of the Administrators group. In an Active Directory domain, you must be logged on to the server by using an account that is a member of the Enterprise Administrators group.

2.   In the console tree of the DHCP snap-in, expand the new DHCP server. If there is a red arrow in the lower-right corner of the server object, the server has not yet been authorized.

3.   Right-click the server object, and then click Authorize.

4.   After several moments, right-click the server again, and then click Refresh. A green arrow indicates that the DHCP server is authorized.

 

Server 2012 CUI to GUI and Vice-versa

Method #1: Convert Server Core to Full Gui using PowerShell

Get ready to convert Server Core to Full Gui using Windows PowerShell. In order to do this, login to Server core with administrator account and open the PowerShell through opened command prompt. To open PowerShell type “start PowerShell” on command prompt and press enter. The PowerShell will open in a new window. See the screenshot.

Start PowerShell on Server Core

Start PowerShell on Server Core

Now convert server core to full Gui using with the following “install-WindowsFeature” PowerShell command.

Fist of all get the name of GUI features with “Get-WindowsFeature *GUI*” command.

Windows GUI Shell

Windows GUI Shell

You see the two Graphical Management Tools and Infrastructure and Server Graphical Shell which we need to install it.

Install-WindowsFeature -Name Server-Gui-Mgmt-Infra, Server-Gui-Shell -Source:E:\sources\install.wim

Convert Server Core to Full Gui

Convert Server Core to Full Gui

The “E:” is the DVD ROM of my computer and the Windows Server 2012 R2 is already in.

OK, when the installing features has finished successfully, restart the server core using “Shutdown -r -t 0” command.

Restart Server Core

Restart Server Core

After rebooting the system, you will see the Windows Server with full Gui and all necessary graphical management tools.

Convert Server Gui to Server Core

Convert Server Gui to Server Core

Finally Windows Server with full Gui is here.

Convert Windows Server Full Gui to Server Core

OK, let’s convert Server from full Gui back to Server Core using “Uninstall-WindowsFeature” PowerShell command. We can do it with graphical as well, but the command is easy and you must learn for exam.

Uninstall-WindowsFeature -Name Name Server-Gui-Mgmt-Infra, Server-Gui-Shell -Restart

Uninstall Windwos Feature with PowerShell

Uninstall Windwos Feature with PowerShell

The command will uninstall and remove features and convert Server Gui to Server Core. After restarting system, you will see your old Server core with only one opened command prompt.

Method #2: Convert Server Core to Full Gui using DISM

Deployment Image Servicing and Management (DISM.exe) is a command-line tool that can be used to service a Windows image or to prepare a Windows Pre-installation Environment (Windows PE) image. DISM can be used to service a Windows image (.wim) or a virtual hard disk (.vhd or .vhdx). But here we are using DISM to Install Windows Features  or convert Server Core to full Gui with DISM.

Dism /online /enable-feature /featurename:ServerCore-FullServer /featurename:Server-Gui-Shell /featurename:Server-Gui-Mgmt /Source:E:\sources\install.wim 

Convert Server Core to Full Gui using DISM

Convert Server Core to Full Gui using DISM

After installing Windows features with DISM, type “Y” to restart the system.

Remove Windows Features with DISM

To remove the Gui features or Convert Server full Gui back to Server Core, do with the following command.

Dism /online /Disable-feature /featurename:ServerCore-FullServer

Default Port Assignments for Common Services

Port Assignments for Commonly-Used Services

There are many services associated with the Windows 2000 operating system. These services might require more than one TCP or UDP port for the service to be functional. Table C.3 shows the default ports that are used by each service mentioned.

Table C.3 Default Port Assignments for Common Services

Service Name UDP TCP
Browsing datagram responses of NetBIOS over TCP/IP 138  
Browsing requests of NetBIOS over TCP/IP 137  
Client/Server Communication   135
Common Internet File System (CIFS) 445 139, 445
Content Replication Service   560
Cybercash Administration   8001
Cybercash Coin Gateway   8002
Cybercash Credit Gateway   8000
DCOM (SCM uses udp/tcp to dynamically assign ports for DCOM) 135 135
DHCP client   67
DHCP server   68
DHCP Manager   135
DNS Administration   139
DNS client to server lookup (varies) 53 53
Exchange Server 5.0    
   Client Server Communication      135
   Exchange Administrator      135
   IMAP      143
   IMAP (SSL)      993
   LDAP      389
   LDAP (SSL)      636
   MTA – X.400 over TCP/IP      102
   POP3      110
   POP3 (SSL)      995
   RPC      135
   SMTP      25
   NNTP      119
   NNTP (SSL)      563
File shares name lookup 137  
File shares session   139
FTP   21
FTP-data   20
HTTP   80
HTTP-Secure Sockets Layer (SSL)   443
Internet Information Services (IIS)   80
IMAP   143
IMAP (SSL)   993
IKE (For more information, see Table C.4) 500  
IPSec Authentication Header (AH) (For more information, see Table C.4)  
IPSec Encapsulation Security Payload (ESP) (For more information, see Table C.4)    
IRC   531
ISPMOD (SBS 2nd tier DNS registration wizard)   1234
Kerberos de-multiplexer   2053
Kerberos klogin 543
Kerberos kpasswd (v5) 464 464
Kerberos krb5 88 88
Kerberos kshell   544
L2TP 1701  
LDAP   389
LDAP (SSL)   636
Login Sequence 137, 138 139
Macintosh, File Services (AFP/IP)   548
Membership DPA   568
Membership MSN   569
Microsoft Chat client to server   6667
Microsoft Chat server to server   6665
Microsoft Message Queue Server 1801 1801
Microsoft Message Queue Server 3527 135, 2101
Microsoft Message Queue Server   2103, 2105
MTA – X.400 over TCP/IP   102
NetBT datagrams 138  
NetBT name lookups 137  
NetBT service sessions   139
NetLogon 138  
NetMeeting Audio Call Control   1731
NetMeeting H.323 call setup   1720
NetMeeting H.323 streaming RTP over UDP Dynamic  
NetMeeting Internet Locator Server ILS   389
NetMeeting RTP audio stream Dynamic  
NetMeeting T.120   1503
NetMeeting User Location Service   522
NetMeeting user location service ULS   522
Network Load Balancing 2504  
NNTP   119
NNTP (SSL)   563
Outlook (see for ports)    
Pass Through Verification 137, 138 139
POP3   110
POP3 (SSL)   995
PPTP control   1723
PPTP data (see Table C.4)    
Printer sharing name lookup 137  
Printer sharing session   139
Radius accounting (Routing and Remote Access) 1646 or 1813  
Radius authentication (Routing and Remote Access) 1645 or 1812  
Remote Install TFTP   69
RPC client fixed port session queries   1500
RPC client using a fixed port session replication   2500
RPC session ports   Dynamic
RPC user manager, service manager, port mapper   135
SCM used by DCOM 135 135
SMTP   25
SNMP 161  
SNMP Trap 162  
SQL Named Pipes encryption over other protocols name lookup 137  
SQL RPC encryption over other protocols name lookup 137  
SQL session   139
SQL session   1433
SQL session   1024 – 5000
SQL session mapper   135
SQL TCP client name lookup 53 53
Telnet   23
Terminal Server   3389
UNIX Printing   515
WINS Manager   135
WINS NetBios over TCP/IP name service 137  
WINS Proxy 137  
WINS Registration   137
WINS Replication   42
X400   102