• About Us
  • Privacy & Policy
HowTo's
  • Home
  • Commands
  • Linux
  • SCM
  • Git
  • Database
  • MySQL
  • Kubernetes
  • Docker
No Result
View All Result
  • Home
  • Commands
  • Linux
  • SCM
  • Git
  • Database
  • MySQL
  • Kubernetes
  • Docker
No Result
View All Result
HowTo's
No Result
View All Result
Home Commands

Managing User Database Entries with Useradd Command

June 21, 2024
in Commands, Linux, Linux Command Tutorial, Linux Commands
A A
0
11
SHARES
103
VIEWS
Share on FacebookShare on Twitter

The useradd command in Unix-like operating systems is used to create new user accounts. It allows system administrators to manage user database entries efficiently. One of the options available with the useradd command is -l (or --no-log-init), which is particularly useful for managing user entries without initializing the user’s login session. Let’s explore how this option works with some examples:

Example 1: Create a new user without initializing the login session:

            $ sudo useradd -l newuser
        

This command adds a new user named “newuser” to the system but does not initialize their login session. To verify, you can check the existence of the user in the system’s user database using commands like id newuser or getent passwd newuser.

Example 2: Add a new user with custom options and without login initialization:

            $ sudo useradd -l -m -s /bin/bash newuser2
        

Here, the -m option creates the user’s home directory and -s /bin/bash sets the user’s default shell. The -l option ensures that the login session is not initialized upon creation.

Example 3: Create a system account without a login session:

            $ sudo useradd -l -r systemuser
        

This command adds a system user named “systemuser” with the -r option, which is typically used for creating accounts used by services and daemons. The -l option ensures no login session is initialized.

Example 4: Create a new user with a specific UID and without login initialization:

            $ sudo useradd -l -u 2001 customuser
        

Here, -u 2001 specifies the UID (User ID) for the user “customuser”. The -l option ensures that no login session is initialized upon creation.

Each of these examples demonstrates how the -l option of the useradd command can be used to manage user database entries without initializing the user’s login session. To verify whether the commands executed successfully, you can use tools such as id, getent, or examine system logs to ensure the user account was created as intended.

Tags: CommandsLinuxLinux Command TutorialLinux Commands
Previous Post

Overriding Default Settings with Useradd Key-Value Pairs in Linux

Next Post

Creating Home Directories Automatically with Useradd Command

Related You may like!

howto

How to Use -iname for Case-Insensitive Filename Searches in find

August 21, 2024
howto

Search for Files with Case-Insensitive Pattern Matching Using -ilname in find

August 21, 2024

Find Files by Group Name with -group in find Command

August 21, 2024

Locate Files by Group ID Using -gid in find Command

August 21, 2024

How to Search for Filesystems with -fstype in find Command

August 21, 2024

Use -false to Test Conditional Expressions in find Command

August 21, 2024
Next Post
howto

Creating Home Directories Automatically with Useradd Command

howto

Preventing Home Directory Creation with Useradd Command

howto

Managing User and Group Creation with Useradd Command

Discussion about this post

Latest Updated

howto

How to Use -iname for Case-Insensitive Filename Searches in find

August 21, 2024
howto

Search for Files with Case-Insensitive Pattern Matching Using -ilname in find

August 21, 2024
howto

Find Files by Group Name with -group in find Command

August 21, 2024
howto

Locate Files by Group ID Using -gid in find Command

August 21, 2024
howto

How to Search for Filesystems with -fstype in find Command

August 21, 2024

Trending in Week

  • howto

    Using BTRFS Subvolume for User Home Directory in Linux

    22 shares
    Share 9 Tweet 6
  • Downloading Docker Images from a Registry

    13 shares
    Share 5 Tweet 3
  • Configuring SSL Connection Mode in mysqldump

    17 shares
    Share 7 Tweet 4
  • Omit Tablespace Information in mysqldump Output

    13 shares
    Share 5 Tweet 3
  • Setting MySQL Dump Compatibility Mode

    18 shares
    Share 7 Tweet 5
  • Setting Network Buffer Length in mysqldump

    13 shares
    Share 5 Tweet 3
  • Logging out from Docker Registries

    13 shares
    Share 5 Tweet 3
  • Scheduling Nodes in Kubernetes with kubectl uncordon

    12 shares
    Share 5 Tweet 3
  • Managing Default User Creation Settings in Linux

    15 shares
    Share 6 Tweet 4
  • Using Extended INSERT Syntax in mysqldump

    12 shares
    Share 5 Tweet 3
  • About Us
  • Privacy & Policy

© 2024 All Rights Reserved. Howto.swebtools.com.

No Result
View All Result

© 2024 All Rights Reserved. Howto.swebtools.com.