What does the usermod command do?

QuestionsQuestions8 SkillsProUser Account ManagementAug, 25 2025
0212

The usermod command in Linux is used to modify user accounts. It allows you to change various attributes of a user account without deleting and recreating it. Some common uses of the usermod command include:

  • Adding a user to supplementary groups with the -aG option.
  • Changing a user's login shell with the -s option.
  • Setting up a home directory for a user with the -d -m option.
  • Renaming a user with the -l option.
  • Setting account expiration dates with the -e option.

Here’s an example of adding a user to a group:

sudo usermod -aG groupname username

This command appends the specified user to the given group.

0 Comments

no data
Be the first to share your comment!