nem.ec

Programming Information Security Recipes Personal Code Snippets

Create and Manage Users and Groups on Linux

Various ways of creating a new user or group on Linux

Source: https://superuser.com/questions/77617/how-can-i-create-a-non-login-user

Create new user

adduser --system --no-create-home --group --disabled-login $USER

Create Group

addgroup --gid 2000 $GROUP

Add existing user to another group

usermod -aG $GROUP $USER
Copied!

Use your own input

If you have values you'd like to use instead of the provided variables, type or paste your data into the variable inputs below. If Javascript is enabled, your text will automatically be added to the command and you can click to copy.