Contact@itspring.com
  • What is meant by usermod command??? How it's used in Linux?? Explain with examples?

    usermod command is used to make changes in any of the conditions and characteristics of already existing user account via command line.

    'useradd' or 'adduser', is used to create new user accounts in Linux. But after creating new account you need to change some attributes like change user's home directory, login name, login shell, change expiry date and many more, in this case 'usermod' command is used.

    Whan we make changes in the user's account, following files are influenced:

    /etc/passwd - Account infomation.

    /etc/shadow - Secure account information.

    /etc/group - Group account information.

    /etc/gshadow - Secure group account information.

    /etc/login.defs - Shadow password suit configuration.

    Lets see the use of usermod command with practical examples.

    1. How to add infomation to user account.

    '-c' or '--comment' - option is used to give new value of the user's password file comment field. /etc/passwd file will be affected and you can see the comment.

    You can check the change with 'grep -E --color' command. Where, grep is used to surrounds the matching pattern with color and '-E' is to interpret pattern as an extended regular expression(ERE).

    Adding information on 'rockboom' user.

    <p>&nbsp;# usermod -c &quot;Hello, here is rocky&quot; rockboom</p>
    <p># grep -E --color 'rockboom' /etc/passwd&nbsp;</p>

Most Liked Posts

Post A Comment

Your email address will not be published. Required fields are marked*

HCRL

0 Comments

No Record found
demo content

The Total Economic Impactâ„¢ of ServiceNow

United States Tue Jun 06 2017

Join us for a webinar where we will reveal the quantified value of the Lightspeed Enterprise for customers that are modernizing IT, eliminating service outages, and optimizing performance with real-time analytics.

Guest speakers Liz Witherspoon of Forrester, and study participant Brad Paubel, VP of Internal Technologies at Maritz, will discuss

  • The value drivers for IT and key quantified economic benefits
  • Key challenges that study customers faced and overcame
  • Focus areas and best practices you can use to drive business impact with ServiceNow

Register

Webinar Registration

Enter the characters visible in the box below

6CV3

Share

Share using

Advertise With Us