Jump to content

A Complete Guide to Usage of ‘usermod’ command

  • Please log in to reply
No replies to this topic

#1 OFFLINE   securitybreach


    CLI Phreak

  • Forum Admins
  • 24,514 posts

Posted 11 November 2014 - 09:53 AM


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.

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:

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.
  • /etc/passwd – User account information.

  • /etc/shadow – Secure account information.

  • /etc/group – Group account information.

  • /etc/gshadow – Secure group account information.

  • /etc/login.defs – Shadow password suite configuration..
Basic syntax of command is:
usermod [options] username

Posted ImagePosted Image
Configs/PGP Key/comhack π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users