useradd, userdel, usermod: highlighting both long and short options (#14338)
This commit is contained in:
@@ -10,24 +10,24 @@
|
|||||||
|
|
||||||
- Create a new user with the specified user ID:
|
- Create a new user with the specified user ID:
|
||||||
|
|
||||||
`sudo useradd --uid {{id}} {{username}}`
|
`sudo useradd {{-u|--uid}} {{id}} {{username}}`
|
||||||
|
|
||||||
- Create a new user with the specified shell:
|
- Create a new user with the specified shell:
|
||||||
|
|
||||||
`sudo useradd --shell {{path/to/shell}} {{username}}`
|
`sudo useradd {{-s|--shell}} {{path/to/shell}} {{username}}`
|
||||||
|
|
||||||
- Create a new user belonging to additional groups (mind the lack of whitespace):
|
- Create a new user belonging to additional groups (mind the lack of whitespace):
|
||||||
|
|
||||||
`sudo useradd --groups {{group1,group2,...}} {{username}}`
|
`sudo useradd {{-G|--groups}} {{group1,group2,...}} {{username}}`
|
||||||
|
|
||||||
- Create a new user with the default home directory:
|
- Create a new user with the default home directory:
|
||||||
|
|
||||||
`sudo useradd --create-home {{username}}`
|
`sudo useradd {{-m|--create-home}} {{username}}`
|
||||||
|
|
||||||
- Create a new user with the home directory filled by template directory files:
|
- Create a new user with the home directory filled by template directory files:
|
||||||
|
|
||||||
`sudo useradd --skel {{path/to/template_directory}} --create-home {{username}}`
|
`sudo useradd {{-k|--skel}} {{path/to/template_directory}} {{-m|--create-home}} {{username}}`
|
||||||
|
|
||||||
- Create a new system user without the home directory:
|
- Create a new system user without the home directory:
|
||||||
|
|
||||||
`sudo useradd --system {{username}}`
|
`sudo useradd {{-r|--system}} {{username}}`
|
||||||
|
@@ -10,8 +10,8 @@
|
|||||||
|
|
||||||
- Remove a user in other root directory:
|
- Remove a user in other root directory:
|
||||||
|
|
||||||
`sudo userdel --root {{path/to/other/root}} {{username}}`
|
`sudo userdel {{-R|--root}} {{path/to/other/root}} {{username}}`
|
||||||
|
|
||||||
- Remove a user along with the home directory and mail spool:
|
- Remove a user along with the home directory and mail spool:
|
||||||
|
|
||||||
`sudo userdel --remove {{username}}`
|
`sudo userdel {{-r|--remove}} {{username}}`
|
||||||
|
@@ -6,20 +6,20 @@
|
|||||||
|
|
||||||
- Change a username:
|
- Change a username:
|
||||||
|
|
||||||
`sudo usermod --login {{new_username}} {{username}}`
|
`sudo usermod {{-l|--login}} {{new_username}} {{username}}`
|
||||||
|
|
||||||
- Change a user ID:
|
- Change a user ID:
|
||||||
|
|
||||||
`sudo usermod --uid {{id}} {{username}}`
|
`sudo usermod {{-u|--uid}} {{id}} {{username}}`
|
||||||
|
|
||||||
- Change a user shell:
|
- Change a user shell:
|
||||||
|
|
||||||
`sudo usermod --shell {{path/to/shell}} {{username}}`
|
`sudo usermod {{-s|--shell}} {{path/to/shell}} {{username}}`
|
||||||
|
|
||||||
- Add a user to supplementary groups (mind the lack of whitespace):
|
- Add a user to supplementary groups (mind the lack of whitespace):
|
||||||
|
|
||||||
`sudo usermod --append --groups {{group1,group2,...}} {{username}}`
|
`sudo usermod {{-a|--append}} {{-G|--groups}} {{group1,group2,...}} {{username}}`
|
||||||
|
|
||||||
- Change a user home directory:
|
- Change a user home directory:
|
||||||
|
|
||||||
`sudo usermod --move-home --home {{path/to/new_home}} {{username}}`
|
`sudo usermod {{-m|--move-home}} {{-d|--home}} {{path/to/new_home}} {{username}}`
|
||||||
|
Reference in New Issue
Block a user