• 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

Allowing Non-Unique User IDs with Useradd Command

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

The useradd command in Linux is used to create new user accounts. One of the options available with this command is -o or --non-unique, which allows the creation of users with non-unique user IDs (UIDs).

When you use the -o option with useradd, it bypasses the usual check that prevents you from creating a user with a UID that already exists on the system. This can be useful in scenarios where you need to create multiple users with the same UID, typically for compatibility with certain applications or environments.

Here are some examples demonstrating the use of useradd -o:

Example 1: Creating a new user with a non-unique UID:
sudo useradd -o john
This command creates a new user account named ‘john’, even if there is already another user with the same UID.

Example 2: Specifying a UID explicitly:
sudo useradd -o -u 1500 sarah
Here, the -u 1500 option sets the UID to 1500 for the new user ‘sarah’, bypassing the UID uniqueness check.

Example 3: Creating a system account with a duplicate UID:
sudo useradd -o -r -u 1001 appuser
This command creates a system account ‘appuser’ with UID 1001, ignoring any existing users with the same UID.

To verify if the useradd command executed successfully, you can follow these steps:

  1. Check the existence of the newly created user by running id username, where ‘username’ is the name of the user you created.
  2. Verify the UID assigned to the user matches the one specified in the command.
  3. Ensure there are no error messages indicating UID conflicts during the user creation process.
Tags: CommandsLinuxLinux Command TutorialLinux Commands
Previous Post

Managing User and Group Creation with Useradd Command

Next Post

Setting Passwords for User Accounts in Linux

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

Setting Passwords for User Accounts in Linux

howto

Creating System Accounts with Useradd Command

howto

Using Chroot Directories 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.