Posts tagged LINUX

How to Install and Configure Ansible on Ubuntu 18.04

Introduction Configuration management systems are designed to make controlling large numbers of servers easy for administrators and operations teams. They allow you to control many different systems in an automated way from one central location. While there are many popular configuration management systems available for Linux systems, such as Chef and Puppet, these are often more complex than many people want or need. Ansible is a great alternative to these options because it requires a much smaller overhead to get started. In this guide, we will discuss how to install Ansible on… Read More

Read More

How to change root password in Ubuntu Linux

By default, the root user account password is locked in Ubuntu Linux for security reasons. As a result, you can not login using root user or use a command such as ‘su -‘ to become a SuperUser.

You need to use the passwd command to change the password for user accounts on Ubuntu Linux. A typical user can only change the password for his/her account only. A SuperUser (root) can change the password for any user account. Your user account info stored in /etc/passswd and an encrypted password stored in /etc/shadow file.

How to change root password in Ubuntu

The procedure to change the root user password on Ubuntu Linux:

  1. Type the following command to become root user and issue passwd:
    sudo -i
    passwd
  2. OR set a password for root user in a single go:
    sudo passwd root
  3. Test it your root password by typing the following command:
    su –

A note about root password on an Ubuntu server/desktop

Enabling the root account by setting the password is not needed. Almost everything you need to do as SuperUser (root) of an Ubuntu server can be done using sudo command. For example, restart apache server:
$ sudo systemctl restart apache2
You can add an additional user to sudo by typing the following command:
$ sudo adduser {userNameHere} sudo
For example, add a user named pankaj to sudo:
$ sudo adduser pankaj sudo

Configuring NTP using chrony

Chrony provides another implementation of NTP and is designed for systems that are often powered down or disconnected from the network. The main configuration file is /etc/chrony.conf  and parameters are similar to those in the /etc/ntp.conf file. – chronyd is the daemon that runs in user space.– chronyc is a command-line program that provides a command prompt and a number of commands. Examples:tracking: Displays system time informationsources: Displays information about current sources. Installing Chrony Install the chrony package by using the following command: # yum install chrony Use the following commands to start chronyd and to… Read More

Read More

Create a new swap partition on RHEL system

For the purpose of this post, let’s assume that you do not have any swap configured on your system. /dev/sdc is the drive referenced with no partitions. Since we are going to make a single partition filling the disk, note that any data currently on that disk will be lost. Follow the steps given below to add /dev/sdc1 partition as the new swap partition on the system. 1. Use the fdisk command as root to create a swap partition. # fdisk /dev/sdc A new prompt will appear, type ‘p’ to… Read More

Read More

Passwordless Login Using SSH Keygen in 5 Easy Steps

SSH (Secure SHELL) is an open source and most trusted network protocol that is used to login into remote servers for execution of commands and programs. It is also used to transfer files from one computer to another computer over the network using secure copy (SCP) Protocol. In this article we will show you how to setup password-less login on RHEL/CentOS 7.x/6.x/5.x and Fedora using ssh keys to connect to remote Linux servers without entering password. Using Password-less login with SSH keys will increase the trust between two Linux servers for easy file synchronization or transfer. My Setup Environment SSH Client : 192.168.0.12… Read More

Read More