cmd/adduser: Difference between revisions
from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< cmd
m Woozle moved page adduser to cmd/adduser: reorganizing command pages |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{hdr/command/linux}} | {{hdr/command/linux}} | ||
[[category:Debian]] | |||
==Basics== | ==Basics== | ||
{{l/cmd|adduser}} is a command for creating users on a [[Debian]]-based system. It is somewhat higher-level than the {{l/cmd|useradd}} command. | |||
* {{ | * '''manpages''': [https://manpages.ubuntu.com/manpages/xenial/en/man8/adduser.8.html Ubuntu], [https://linux.die.net/man/8/adduser die.net] | ||
==Example== | |||
This should add a new user with sudo privileges, no password, and skips the interactive prompts (but I have not tested it yet): | |||
{{fmt/arg/opt|sudo}} adduser --disabled-password --gecos "" {{fmt/arg|username}} | |||
{{fmt/arg/opt|sudo}} usermod -aG sudo {{fmt/arg|username}} | |||
* The "sudo" is optional if you are acting as root. | |||
* "<code>--disabled-password</code>" sets the password field to "<code>!</code>", which apparently disables all password authentication. | |||
* the "sudo" group (in the 2nd command) is for [[Debian]]-derived Linux flavors; [[Red Hat]] flavors apparently use the "wheel" group. | |||
==Related== | |||
* {{l/cmd|usermod}} | |||
Latest revision as of 13:27, 25 June 2026
<hide> page type::reference thing type::command platform::Linux </hide>
Basics
adduser is a command for creating users on a Debian-based system. It is somewhat higher-level than the useradd command.
Example
This should add a new user with sudo privileges, no password, and skips the interactive prompts (but I have not tested it yet):
[ <sudo> ] adduser --disabled-password --gecos "" <username> [ <sudo> ] usermod -aG sudo <username>
- The "sudo" is optional if you are acting as root.
- "
--disabled-password" sets the password field to "!", which apparently disables all password authentication. - the "sudo" group (in the 2nd command) is for Debian-derived Linux flavors; Red Hat flavors apparently use the "wheel" group.
