useradd, userdel, usedmod, users: refresh page (#7661)
This commit is contained in:

committed by
GitHub

parent
3a104d8676
commit
684f7bbc65
@@ -1,24 +1,33 @@
|
||||
# useradd
|
||||
|
||||
> Create a new user.
|
||||
> See also: `users`, `userdel`, `usermod`.
|
||||
> More information: <https://manned.org/useradd>.
|
||||
|
||||
- Create new user:
|
||||
- Create a new user:
|
||||
|
||||
`useradd {{name}}`
|
||||
`sudo useradd {{username}}`
|
||||
|
||||
- Create new user with a default home directory:
|
||||
- Create a new user with the specified user id:
|
||||
|
||||
`useradd --create-home {{name}}`
|
||||
`sudo useradd --uid {{id}} {{username}}`
|
||||
|
||||
- Create new user with specified shell:
|
||||
- Create a new user with the specified shell:
|
||||
|
||||
`useradd --shell {{path/to/shell}} {{name}}`
|
||||
`sudo useradd --shell {{path/to/shell}} {{username}}`
|
||||
|
||||
- Create new user belonging to additional groups (mind the lack of whitespace):
|
||||
- Create a new user belonging to additional groups (mind the lack of whitespace):
|
||||
|
||||
`useradd --groups {{group1,group2}} {{name}}`
|
||||
`sudo useradd --groups {{group1,group2,...}} {{username}}`
|
||||
|
||||
- Create new system user without a home directory:
|
||||
- Create a new user with the default home directory:
|
||||
|
||||
`useradd --no-create-home --system {{name}}`
|
||||
`sudo useradd --create-home {{username}}`
|
||||
|
||||
- Create a new user with the home directory filled by template directory files:
|
||||
|
||||
`sudo useradd --skel {{path/to/template_directory}} --create-home {{username}}`
|
||||
|
||||
- Create a new system user without the home directory:
|
||||
|
||||
`sudo useradd --system {{username}}`
|
||||
|
@@ -1,21 +1,17 @@
|
||||
# userdel
|
||||
|
||||
> Remove a user account or remove a user from a group.
|
||||
> Note: all commands must be executed as root.
|
||||
> See also: `users`, `useradd`, `usermod`.
|
||||
> More information: <https://manned.org/userdel>.
|
||||
|
||||
- Remove a user:
|
||||
|
||||
`userdel {{name}}`
|
||||
|
||||
- Remove a user along with their home directory and mail spool:
|
||||
|
||||
`userdel --remove {{name}}`
|
||||
|
||||
- Remove a user from a group:
|
||||
|
||||
`userdel {{name}} {{group}}`
|
||||
`sudo userdel {{username}}`
|
||||
|
||||
- Remove a user in other root directory:
|
||||
|
||||
`userdel --root {{path/to/other/root}} {{name}}`
|
||||
`sudo userdel --root {{path/to/other/root}} {{username}}`
|
||||
|
||||
- Remove a user along with the home directory and mail spool:
|
||||
|
||||
`sudo userdel --remove {{username}}`
|
||||
|
@@ -1,16 +1,25 @@
|
||||
# usermod
|
||||
|
||||
> Modifies a user account.
|
||||
> See also: `users`, `useradd`, `userdel`.
|
||||
> More information: <https://manned.org/usermod>.
|
||||
|
||||
- Change a user's name:
|
||||
- Change a username:
|
||||
|
||||
`usermod -l {{newname}} {{user}}`
|
||||
`sudo usermod --login {{new_username}} {{username}}`
|
||||
|
||||
- Add user to supplementary groups (mind the whitespace):
|
||||
- Change a user id:
|
||||
|
||||
`usermod -a -G {{group1,group2}} {{user}}`
|
||||
`sudo usermod --uid {{id}} {{username}}`
|
||||
|
||||
- Create a new home directory for a user and move their files to it:
|
||||
- Change a user shell:
|
||||
|
||||
`usermod -m -d {{path/to/home}} {{user}}`
|
||||
`sudo usermod --shell {{path/to/shell}} {{username}}`
|
||||
|
||||
- Add a user to supplementary groups (mind the lack of whitespace):
|
||||
|
||||
`sudo usermod --append --groups {{group1,group2,...}} {{username}}`
|
||||
|
||||
- Change a user home directory:
|
||||
|
||||
`sudo usermod --move-home --home {{path/to/new_home}} {{username}}`
|
||||
|
Reference in New Issue
Block a user