2014-03-24 03:45:45 +04:00
|
|
|
# useradd
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
> Create a new user.
|
2014-03-24 03:45:45 +04:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Create new user:
|
2014-03-24 03:45:45 +04:00
|
|
|
|
2014-08-18 10:22:39 +04:00
|
|
|
`useradd {{name}}`
|
2014-03-24 03:45:45 +04:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Create new user with a default home directory:
|
2014-03-24 03:45:45 +04:00
|
|
|
|
2016-09-10 21:35:35 +03:00
|
|
|
`useradd --create-home {{name}}`
|
2014-03-24 03:45:45 +04:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Create new user with specified shell:
|
2014-03-24 03:45:45 +04:00
|
|
|
|
2016-09-10 21:35:35 +03:00
|
|
|
`useradd --shell {{/path/to/shell}} {{name}}`
|
2014-03-24 03:45:45 +04:00
|
|
|
|
2016-09-10 21:34:16 +03:00
|
|
|
- Create new user belonging to additional groups (mind the lack of whitespace):
|
2014-03-24 03:45:45 +04:00
|
|
|
|
2016-09-10 21:35:35 +03:00
|
|
|
`useradd --groups {{group1,group2}} {{name}}`
|
2016-09-10 12:45:36 +03:00
|
|
|
|
|
|
|
- Create new system user without a home directory:
|
|
|
|
|
|
|
|
`useradd --no-create-home --system {{name}}`
|