• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

useradd

Useradd With Specific uid and guid

November 5, 2021

Here’s the command to create a Linux user with a specific user id and group id.

sudo groupadd -r -g 1234567 username
sudo useradd -r -u 1234567 -g 1234567 -m -d /home/username -s /bin/bash nexus -c "my new account"

sudo groupadd -r -g 1234567 username sudo useradd -r -u 1234567 -g 1234567 -m -d /home/username -s /bin/bash nexus -c "my new account"

Filed Under: Linux Tagged With: create, guid, home, linux, uid, user, useradd

Linux Useradd

June 16, 2020

Here’s the command to add a Linux user.

useradd -m -s $(which bash) -G sudo ulysses

useradd -m -s $(which bash) -G sudo ulysses

-m creates a home directory. -s selects a shell. -G adds user to a sudo group.

Filed Under: Linux Tagged With: group, home directory, shell, useradd

  • Home
  • About
  • Archives

Copyright © 2023