Day - 11 of DevOps

Day - 11 of DevOps

Linux System Administration Commands - Part 5

1. useradd:

  • Command: useradd

  • Purpose: Adds a new user account to the system.

  • Usage: sudo useradd username

  • Additional Information:

    • It adds a new entry to the /etc/passwd file, which contains basic user information.

    • Password-related information is stored in the /etc/shadow file.

2. adduser:

  • Command: adduser

  • Purpose: A higher-level utility, often a Perl script, that interacts with useradd to provide a more user-friendly and interactive way to create users.

  • Usage: sudo adduser username

  • Additional Information:

    • It also manages the user's home directory and initial settings.

    • Helps in setting up the user's environment, including the home directory and shell.

  • /etc/passwd: Contains basic user information, such as user IDs, group IDs, home directories, and login shells.

  • /etc/shadow: Stores encrypted password information for users.

    • Accessible only by the root user.

    • Enhances security by keeping sensitive information separate.

3. groupadd:

  • Command: groupadd

  • Purpose: Creates a new group on the system.

  • Usage: sudo groupadd groupname

  • Additional Information:

    • It adds a new entry to the /etc/group file, containing group information.

    • Group password-related information is stored in the /etc/gshadow file.

  • /etc/group: Contains information about groups on the system.

  • /etc/gshadow: Stores group password information.