2014-03-23 23:45:45 +00:00
|
|
|
# useradd
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Create a new user.
|
2021-04-17 13:19:41 +01:00
|
|
|
> More information: <https://manned.org/useradd>.
|
2014-03-23 23:45:45 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Create new user:
|
2014-03-23 23:45:45 +00:00
|
|
|
|
2014-08-18 07:22:39 +01:00
|
|
|
`useradd {{name}}`
|
2014-03-23 23:45:45 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Create new user with a default home directory:
|
2014-03-23 23:45:45 +00:00
|
|
|
|
2016-09-10 19:35:35 +01:00
|
|
|
`useradd --create-home {{name}}`
|
2014-03-23 23:45:45 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Create new user with specified shell:
|
2014-03-23 23:45:45 +00:00
|
|
|
|
2020-10-28 17:19:43 +00:00
|
|
|
`useradd --shell {{path/to/shell}} {{name}}`
|
2014-03-23 23:45:45 +00:00
|
|
|
|
2016-09-10 19:34:16 +01:00
|
|
|
- Create new user belonging to additional groups (mind the lack of whitespace):
|
2014-03-23 23:45:45 +00:00
|
|
|
|
2016-09-10 19:35:35 +01:00
|
|
|
`useradd --groups {{group1,group2}} {{name}}`
|
2016-09-10 10:45:36 +01:00
|
|
|
|
|
|
|
- Create new system user without a home directory:
|
|
|
|
|
|
|
|
`useradd --no-create-home --system {{name}}`
|