Author: Sahil Suri

How to replicate user passwords across hosts using /etc/shadow file

Introduction Today I received an interesting requirement.  A customer wanted their FTP users on several new servers (having the same username) to have the same password as that of the users on an older server. The problem was that they did not actually know the passwords of the users on the old servers. Also, the process had to be largely automated because it needed to be repeated on multiple machines. So, after some research, I was able to come up with a solution. The solution to this problem was to use the user entries from the /etc/shadow file. Before we delve into the details of how the /etc/shadow file entries for some users could allow us to replicate their passwords across several machines, let’s first understand the different fields of the /etc/shadow file. The /etc/shadow file is a text file and has permissions set to 400 i.e. -r——– and its ownership is set to root:root. This implies that it can be read by the root user only and is implemented as a needed security mechanism. Let’s view an entry from the file: [root@linuxnix ~]# grep sahil /etc/shadow sahil:$6$ufcRl1.z$HC2JFSgFZkFiprGQ/dzWIH9NcxmF.WqldAbbmy.ra4/uoAOdST.NhRZp/BKalt0JEOEdXSJj48uGJxnImuyRo0:17517:0:99999:7::: [root@linuxnix ~]# As you might’ve observed the /etc/shadow file uses the colon (:) as a delimiter to separate different fields. This is similar to the /etc/passwd file. The /etc/shadow has 8 different fields which are as follows: Username Username is user’s...

Read More

How to check memory usage in Linux

Introduction The ability to check memory usage on Linux systems follows the popular UNIX philosophy “there’s more than one way to do it”. We have multiple commands to check and diagnose memory usage on Linux systems. The free command displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel. The vmstat command reports information about processes, memory, paging, block IO, traps, and CPU activity. We can use the top command to obtain a dynamic real-time view of a running system. The top command can display system summary information as well as a list of tasks currently being managed by the Linux kernel. If we are using a system that has a GUI interface then we could also use the gnome-system-monitor to view memory utilization. High memory usage can cause severe performance bottlenecks on systems if not monitored properly and kept within certain threshold limits. These threshold limits may vary depending on the available memory resources and the type of workloads residing on the system. A system low on memory can have several adverse implications like not being able to serve visitors accessing a website on a web server, the shutdown of network and other system services and at times even causing the system to hang followed by a subsequent system crash. In this article, we...

Read More

GRUB bootloader basics

Introduction A bootloader is a small program that loads up code required for operating system startup. This mainly includes the location of the operating system kernel and the options which should be used to load the kernel. GRUB is an acronym for “GRand Unified Bootloader”. It works with the BIOS (Basic Input Output System) firmware and supports multiple boot options, such as various Linux boot modes, and other operating systems like Windows, BSD, and so on. We are slowly seeing a migration from the legacy BIOS system towards firmware that is based on the UEFI (Unified Extensible Firmware Interface). It was originally developed by Intel and used for their Itanium systems. This provided a new way to boot the operating system moving away from the BIOS and MBR. With this, we can also implement a secure boot mechanism by performing cryptographic signing of the bootloader. UEFI requires EFI system partition which is usually Fat32. UEFI is not limited to reading the 446 byte bootstrap code in the MBR. The GRUB2 and Syslinux bootloaders support both BIOS and UEFI whereas the legacy GRUB bootloader and LILO only support BIOS. The GRUB bootloader is deployed with Centos 6, RHEL 6 and SLES 11 operating systems. In this article, we intend to provide a basic introduction to the GRUB bootloader.   GRUB configuration file: The GRUB configuration file is /boot/grub/menu.lst. Given below...

Read More

Over 16,000 readers, Get fresh content from “The Linux juggernaut”

Email Subscribe

ABOUT ME..!

My photo
My name is Surendra Kumar Anne. I hail from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present I work at Bank of America as Sr. Analyst Systems and Administration. You can contact me at surendra (@) linuxnix dot com.