Skip to content
Published on

Linux User and Group Commands

Authors

Overview

Let's learn about the types of HBase Client APIs used to work with HBase.

useradd, userdel

Key useradd options

  • -m: Create the user's home directory along with the user
  • -d directory: Use directory as the user's home directory
  • -e date: Specify date as the account expiration date
  • -g group_id: Use group_id as the user's group ID
  • -G group1, group2: Specify the user's group membership (multiple groups)
  • -P password: Set password as the password
useradd,
    # Create a new user
    $ useradd user
    # Create a user with an account expiration date
    $ useradd -e 2022-12031 user

    # Delete a user
    $ userdel user

useradd, userdel

Key groupadd options

  • -g gid: Use gid as the group ID
  • -o: When creating a group with a group ID specified by the -g option, ignore errors even if the ID already exists and create the group anyway
groupadd,
    # Create a new group
    $ groupadd mygroup
    # Create with group_id 555
    $ groupadd -g 555 mygroup
    # Delete a group
    $ groupdel mygroup

That concludes this post on how to add and delete Linux users and groups. Thank you.

Quiz

Q1: What is the main topic covered in "Linux User and Group Commands"? How to add or delete Users and Groups in Linux

Q2: What is Key useradd options? -m: Create the user's home directory along with the user -d directory: Use directory as the user's home directory -e date: Specify date as the account expiration date -g group_id: Use group_id as the user's group ID -G group1, group2: Specify the user's group membership (multiple...

Q3: Explain the core concept of Key groupadd options. -g gid: Use gid as the group ID -o: When creating a group with a group ID specified by the -g option, ignore errors even if the ID already exists and create the group anyway That concludes this post on how to add and delete Linux users and groups. Thank you.