Showing posts with label RHEL7. Show all posts
Showing posts with label RHEL7. Show all posts

Wednesday, 26 July 2017

Mount & Unmount CD/DVD-ROM/USB in Linux

How do I mount a USB, CD-ROM or DVD drive on a Linux operating system using command line bash shell based options

You need to use the mount command to mount a CD-ROM or DVD disk under a Linux operating systems. First, you need to insert the CD or DVD in the server / laptop or desktop drive. Next, type the following mount command as the root use to mount discs.

Step 1 :Finding out your CD/DVD names in Linux

Use the following command to find out the name Of DVD / CD-ROM / Writer / Blu-ray device on a Linux based system:

# lsblk

OR

# dmesg | egrep -i --color 'cdrom|dvd|cd/rw|writer'

Sample outputs (/dev/sr0):
[ 5.437164] sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
[ 5.437307] cdrom: Uniform CD-ROM driver Revision: 3.20

Step 2: Syntax to mount DVD / CDROM in Linux

The syntax is:
# mount -t iso9660 -o ro /dev/deviceName /path/to/mount/point

Create a mount point, type mkdir command as follows:
# mkdir -p /mnt/cdrom

Mount /dev/cdrom or /dev/sr0 as follows:
# mount -t iso9660 -o ro /dev/cdrom /mnt/cdrom

OR

# mount -t iso9660 -o ro /dev/sr0 /mnt/cdrom
Verify that CD/DVD mounted at the /cdrom or /mnt/cdrom, enter:
#mount df

/cdrom or /mnt/cdrom represents the mount point of the CD or DVD. To view or browse CD or DVD, enter:

# ls -l /cdrom
# cd /cdrom
# ls

Step 3: How do I Unmount CD-ROM or DVD on Linux?

Type the following command as the root user:
# umount /cdrom

OR

# umount /dev/cdrom

OR

# umount /mnt/cdrom

Thursday, 8 October 2015

Install Telnet Server on CentOS 7 / RHEL 7

The tutorial explains about how to install telnet server on CentOS 7 / RHEL 7 . We will also keep SELINUX on enforcing mode and use the firewalld rules.

About Telnet

Telnet is a network protocol used on the Internet or local area networks to provide a bidirectional interactive text-oriented communication facility using a virtual terminal connection .
Recommended: We always recommend to use SSH because it communicates in encrypted way. Whereas telnet do not communicates in encrypted way.

Telnet Port Number

By default telnet server listens on port number 23/tcp .
To know more about telnet, read this Wikipedia link.
IMPORTANT NOTE:
By default root is not able to login via telnet. Hence, use other system user.
Diagram :
telnet server

Description about our Lab :

Operating System : CentOS 7
IP Address : 192.168.56.101 (This is also telnet server ip address)
Arch : x86_64

Install Telnet Server

Installing telnet-server is quite easy, Simply run the below command on your system terminal.
 
#yum install telnet-server

Start/Stop/Restart Telnet service

To start the telnet service on CentOS 7 / RHEL 7 use the command –
#systemctl start telnet.socket

To stop the telnet service on CentOS 7 / RHEL 7 use the command –
#systemctl stop telnet.socket

To restart the telnet service on CentOS 7 / RHEL 7 use the command –
#systemctl restart telnet.socket

To get status of the telnet service on CentOS 7 / RHEL 7 use the command –
#systemctl status telnet.socket

Check listening port by telnet

To check listening port 23 by telnet on system, use ss command –
ss -tnlp|grep 23 
 
Below given is reference from our system.It shows the port number 23 is listening.
[root@localhost ~]# ss -tnlp|grep 23 
LISTEN 0 128 :::23 :::* users:(("systemd",1,53)) 
[root@localhost ~]#

Allow telnet from firewall

We strictly recommend to use the telnet-server inside LAN only. It should not be accessible from Public network.
In below section, we are allowing source subnet 192.168.56.0/24 to access the telnet service by using firewalld command.
(Replace the 192.168.56.0/24 with your LAN network subnet or client ip address)

firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.56.0/24" service name="telnet" log prefix="telnet" level="info" limit value="1/m" accept'

Access telnet-server

To access telnet-server, use the following command syntax

Syntax: Replace telnet-server-ip-address with ip address of telnet server.
telnet telnet-server-ip-address 

It will prompt for giving username and password. Use system username other than root.

sharad@linuxworld:~/Desktop$ telnet 192.168.56.101
Trying 192.168.56.101...
telnet: Unable to connect to remote host: No route to host
sharad@linuxworld:~/Desktop$ telnet 192.168.56.101
Trying 192.168.56.101...
Connected to 192.168.56.101.
Escape character is '^]'.

Kernel 3.10.0-123.el7.x86_64 on an x86_64
localhost login: test
Password: 
Last login: Sat Dec  6 08:01:10 from ::ffff:192.168.56.1
[test@localhost ~]$
 

How configure Telnet client on Window 7

Open command prompt and run telnet command
windowclient-telnet
Error
 'telnet' is not recognized as an internal or external command, operable program or batch file.
windowclient-unrecognized-telnet
You will get error because Window 7 does not turn on telnet client service automatic. We need to start it manually.
Open control panel and click on program.
windowclient-control-pannel-program
click on turn windows features on or off
windowclient-program-window
Scroll down and check mark on Telnet client and click on OK
windowclient-checked-telnet
Now you can run telnet command. Login form normal user
windowclient-logged-in-normal-user
logout from normal user and try to login from root
windowclient-exit-from-normal-user
By default root user is not allowed to login through the terminal session
windowclient-root-fail
To allow root user Go on server system and open /etc/securetty file
server-etc-securetty
In the end of file add pts/0 and save the file
server-pts
Go back on windowclient system and try again to login from root user
windowclient-root-sucess
In this article I have configured Telnet server on RHEL7 system in LAB environment.
 

Tuesday, 23 June 2015

HOW TO CONFIGURE DHCP SERVER ON CENTOS/RHEL 7/6/5

DHCP ( Dynamic Host Configuration Protocol ) is a network protocol used for assigning IP address to network clients dynamically from predefined IP pool. It is useful for LAN network, but not generally used for production servers. This article will help you for Configuring DHCP Server on CentOS, Red Hat System. Read more about dhcp here.

Install DHCP Package

First install dhcp packages using yum package manager on CentOS, Red hat systems. DHCP rpms are available under base repositories, so we don’t need to add extra repository.

# yum install dhcp

Update /etc/sysconfig/dhcpd File

Firstly we need to set ethernet interface name as DHCPDARGS in /etc/sysconfig/dhcpd file. Edit this configuration file and update the ethernet name.

DHCPDARGS=eth1

Configure DHCP Server

DHCP creates an empty configuration file/etc/dhcp/dhcpd.conf. Also it provides a sample configuration file at/usr/share/doc/dhcp*/dhcpd.conf.sample, which is very useful for configuring the DHCP server.

So as a first part, copy content of sample configuration file to main configuration file. Sample configuration file may be changed as per version you have installed on your system.

# cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf

3.1 – Parameter Configuration

First configure the basic options which is common to all supported networks.

option domain-name "techinforockz.com"; option domain-name-servers ns1. techinforockz.com, ns2. techinforockz.com;
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;

3.2 – IP Subnet Declaration

First edit dhcp configuration file and update subnet details as per your network. For this example we are configuring DHCP for192.168.1.0/24 LAN network.

subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.254;
option subnet-mask 255.255.255.0;
option domain-search " techinforockz.com";
option domain-name-servers 192.168.1.1; option time-offset -18000;
#Eastern Standard Time
range 192.168.1.10 192.168.1.100; }

3.3 -Assign Static IP Address to Host

In some cases we need to assign a fixed ip to an interface each time it requested from dhcp. We can also assign a fixed ip on basis of MAC address (hardware ethernet) of that interface. Setup host-name is optional to set up.

host station1 { option host-name "station1.example.com"; hardware ethernet 00:11:1A:2B:3C:AB; fixed-address 192.168.1.100; }

Start DHCP Service

After making all above changes, let’s start dhcp service using following commands as per your operating system version.

For CentOS/RHEL 7
#systemctl start dhcp

For CentOS/RHEL 6/5
#service dhcp start

Similarly to stop and restart dhcp service use following commands.

For CentOS/RHEL 7
#systemctl stop dhcp
#systemctl restart dhcp

For CentOS/RHEL 6/5
#service dhcp stop
#service dhcp restart

Step 5: Setup Client System

At this stage we have a running dhcp server which is ready for accepting requests and assign them a proper ip. but to verify I have another CentOS machine running on same LAN. Now login to that client machine and edit Ethernet configuration file.

#vim /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
BOOTPROTO=dhcp
TYPE=Ethernet
ONBOOT=yes

Make sure BOOTPROTO is set to dhcp.

Let’s restart network services on client system. You will get that dhcp server assigned an ip address from defined subnet. If you have connected to client pc from remote login, Your session can be disconnect.

For CentOS/RHEL 7
#systemctl restart network

For CentOS/RHEL 6/5
#service network restart

That's all..

Wednesday, 20 May 2015

Linux OS Download Links

RHEL 7 Features and Extras

RHEL 7 Features and Extras
Introduction of DockerDocker is an open source project that automates the deployment of applications inside Linux Containers, and provides the capability to package an application with its runtime dependencies into a container.
Device Hotplug RemovedWhile RHEL 5/6 has device hotplug support (udev rule that runs the ifup script for newly created devices), it has been disabled for RHEL 7 since it can result in race conditions when initializing newly found.
No 32 Bit ISO ImageNo 32 bit ISO for download. Red Hat Enterprise Linux 7 will only provide 64-bit ISO's, thus allowing only a 64-bit operating environment. RHEL 7 will not natively support 32-bit hardware.
MemAvailable Added to meminfoA new entry to the /proc/meminfo file has been introduced to provide the MemAvailable field. MemAvailable provides an estimate of how much memory is available for starting new applications, without swapping. However, unlike the data provided by the Cache or Free fields, MemAvailable takes into account page cache and also that not all reclaimable memory slabs will be reclaimable due to items being in use.
New Ruby and Python VersionsRed Hat Enterprise Linux 7 provides the latest Ruby version, 2.0.0 and Python 2.7.5.
OpenJDK7 Made DefaultRed Hat Enterprise Linux 7 features OpenJDK7 as the default Java Development Kit (JDK) and Java 7 as the default Java version.
More Powerful NetworkManager
NetworkManager has been significantly enhanced to configure and monitor all the networking features for enterprise class servers and for desktop applications.

For the enterprise data centers, NetworkManager can be used for tasks such as basic networking configuration, network teaming, configuring virtual LANs, bridges, bonds, IPv6, VPNs, assigning interfaces to firewall zones, and others. For desktop servers it can manage wired and wireless networks and VPNs.
Support for 40 Gigabit NICsRed Hat Enterprise Linux 7 supports 40 Gigabit network interface controllers (NICs) from multiple hardware partners. This provides support for 40 Gigabit Ethernet link speeds enabling faster network communication for applications and systems. Note that the ethtool utility will report interface link speeds up to 40Gb data rates.
No RHN ClassicRHN Classic is not supported in RHEL7. Older versions supported different subscription management method being used. Red Hat Subcription Management is the only one used by RHEL 7.
OpenSSH - Multiple Required AuthenticationsRed Hat Enterprise Linux 7 supports multiple required authentications in SSH protocol version 2 using the AuthenticationMethods option. This option lists one or more comma-separated lists of authentication method names. Successful completion of all the methods in any list is required for authentication to complete.
Minimum Disk Space for Installation of RHEL7Red Hat Enterprise Linux 7 now requires at least 1 GB of disk space to install. However, Red Hat recommends a minimum of 5 GB of disk space for all supported architectures.
Implementation of tmpfs file systemRed Hat Enterprise Linux 7 offers the ability to use /tmp as a mount point for a temporary file storage system (tmpfs).

When enabled, this temporary storage appears as a mounted file system, but stores its content in volatile memory instead of on a persistent storage device. No files in /tmp are stored on the hard drive except when memory is low, in which case swap space is used. This means that the contents of /tmp are not persisted across a reboot.
New Logging FrameworkRed Hat Enterprise Linux 7 introduces a new logging daemon, journald, as part of the move to systemd.

journald captures the following types of message for all services:

- syslog messages
- kernel messages
- initial RAM disk and early boot messages
- messages sent to standard output and standard error output.
Changes to mount optionsUnlike ext3 and ext4, the XFS file system enables the user_xattr and acl mount options by default. Ext3 and ext4 file systems do not enable these attributes by default.

Major differences between RHEL 7 and 6 variants..

This page would list out some of the major differences between RHEL 7 and 6 variants. This is not a complete list. To know more one would visit the links that I've pasted below and check further.


FeaturesRHEL 7RHEL 6
Default File SystemXFSEXT4
Kernel Version3.10.x-x kernel2.6.x-x Kernel
Kernel Code NameMaipoSantiago
General Availability Date of First Major Release2014-06-09 (Kernel Version 3.10.0-123)2010-11-09 (Kernel Version 2.6.32-71)
First Processsystemd (process ID 1)init (process ID 1)
Runlevelrunlevels are called as "targets" as shown below:

runlevel0.target -> poweroff.target
runlevel1.target -> rescue.target
runlevel2.target -> multi-user.target
runlevel3.target -> multi-user.target
runlevel4.target -> multi-user.target
runlevel5.target -> graphical.target
runlevel6.target -> reboot.target

/etc/systemd/system/default.target (this by default is linked to the multi-user target)
Traditional runlevels defined :

runlevel 0
runlevel 1
runlevel 2
runlevel 3
runlevel 4
runlevel 5
runlevel 6

and the default runlevel would be defined in /etc/inittab file.
/etc/inittab
Host Name ChangeIn Red Hat Enterprise Linux 7, as part of the move to the new init system (systemd), the hostname variable is defined in /etc/hostname.In Red Hat Enterprise Linux 6, the hostname variable was defined in the /etc/sysconfig/network configuration file.
Change In UID AllocationBy default any new users created would get UIDs assigned starting from 1000.

This could be changed in /etc/login.defs if required.
Default UID assigned to users would start from 500.


This could be changed in /etc/login.defs if required.
Max Supported File SizeMaximum (individual) file size = 500TB
Maximum filesystem size = 500TB

(This maximum file size is only on 64-bit machines. Red Hat Enterprise Linux does not support XFS on 32-bit machines.)
Maximum (individual) file size = 16TB
Maximum filesystem size = 16TB

(This maximum file size is based on a 64-bit machine. On a 32-bit machine, the maximum files size is 8TB.)
File System Check"xfs_repair"

XFS does not run a file system check at boot time.
"e2fsck"

File system check would gets executed at boot time.
Differences Between xfs_repair & e2fsck
"xfs_repair"

- Inode and inode blockmap (addressing) checks.
- Inode allocation map checks.
- Inode size checks.
- Directory checks.
- Pathname checks.
- Link count checks.
- Freemap checks.
- Super block checks.

"e2fsck"

- Inode, block, and size checks.

- Directory structure checks.

- Directory connectivity checks.

- Reference count checks.

- Group summary info checks.
Difference Between xfs_growfs & resize2fs"xfs_growfs"

xfs_growfs takes mount point as arguments.
"resize2fs"

resize2fs takes logical volume name as arguments.
Change In File System Structure/bin, /sbin, /lib, and /lib64 are now nested under /usr./bin, /sbin, /lib, and /lib64 are usually under /
Boot LoaderGRUB 2
Supports GPT, additional firmware types, including BIOS, EFI and OpenFirmwar. Ability to boot on various file systems (xfs, ext4, ntfs, hfs+, raid, etc)
GRUB 0.97
KDUMPRHEL7 supports kdump on large memory based systems up to 3 TBKdump doesn’t work properly with large RAM based systems.
System & Service Manager"Systemd"

systemd is a system and service manager for Linux, and replaces SysV and Upstart used in previous releases of Red Hat Enterprise Linux. systemd is compatible with SysV and Linux Standard Base init scripts.
Upstart
Enable/Start ServiceFor RHEL 7, the systemctl command replaces service and chkconfig.

- Start Service : "systemctl start nfs-server.service".

- Enable Service : To enable the service (example: nfs service ) to start automatically on boot : "systemctl enable nfs-server.service".

Although one can still use the service and chkconfig commands to start/stop and enable/disable services, respectively, they
are not 100% compatible with the RHEL 7 systemctl command (according to redhat).
Using "service" command and "chkconfig" commands.

- Start Service : "service start nfs" OR "/etc/init.d/nfs start"

- Enable Service : To start with specific runlevel : "chkconfig --level 3 5 nfs on"
Default Firewall"Firewalld (Dynamic Firewall)"

The built-in configuration is located under the /usr/lib/firewalld directory. The configuration that you can customize is under the /etc/firewalld directory. It is not possible to use Firewalld and Iptables at the same time. But it is still possible to disable Firewalld and use Iptables as before.
Iptables
Network Bonding"Team Driver"

-/etc/sysconfig/network-scripts/ifcfg-team0
- DEVICE=”team0”
- DEVICETYPE=”Team”
"Bonding"

-/etc/sysconfig/network-scripts/ifcfg-bond0
- DEVICE=”bond0”
Network Time SynchronizationUsing Chrony suite (faster time sync compared with ntpd)Using ntpd
NFSNFS4.1
NFSv2 is no longer supported. Red Hat Enterprise Linux 7 supports NFSv3, NFSv4.0, and NVSv4.1 clients.
NFS4
Cluster Resource ManagerPacemakerRgmanager
Load Balancer TechnologyKeepalived and HAProxyPiranha
Desktop/GUI InterfaceGNOME3 and KDE 4.10GNOME2
Default DatabaseMariaDB is the default implementation of MySQL in Red Hat Enterprise Linux 7MySQL
Managing Temporary FilesRHEL 7 uses systemd-tmpfiles (more structured, and configurable, method to manage tmp files and directories).Using "tmpwatch"