Pages

Thursday, June 29, 2017

A Complete Guide to Usage of ‘usermod’ command – 15 Practical Examples with Screenshots

In Unix/Linux distributions, the command ‘usermod‘ is used to modify or change any attributes of a already created user account via command line. The command ‘usermod‘ is similar to that ‘useradd‘ or ‘adduser‘ but the login granted to an existing user.
usermod Command Examples
15 usermod Command Examples
The command ‘useradd‘ or ‘adduser‘ is used for creating user accounts in Linux systems. To know more about on how to create system users, read our complete guide at:

  1. A Complete Guide to “useradd” Command in Linux
After creating user accounts, in some scenarios where we need to change the attributes of an existing user such as, change user’s home directory, login name, login shell, password expiry date, etc, where in such case ‘usermod’ command is used.
When we execute ‘usermod‘ command in terminal, the following files are used and affected.
  1. /etc/passwd – User account information.
  2. /etc/shadow – Secure account information.
  3. /etc/group – Group account information.
  4. /etc/gshadow – Secure group account information.
  5. /etc/login.defs – Shadow password suite configuration..
Basic syntax of command is:
usermod [options] username

Requirements

  1. We must have existing user accounts to execute usermod command.
  2. Only superuser (root) is allowed to execute usermod command.
  3. The usermod command can be executed on any Linux distribution.
  4. Must have basic knowledge of usermod command with options

Options of Usermod

The ‘usermod‘ command is simple to use with lots of options to make changes to an existing user. Let us see how to use usermod command by modifying some existing users in Linux box with the help of following options.
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
                                                    ► Read more: http://adf.ly/1nBXgz
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

No comments:

Post a Comment