useradd, userdel, usedmod, users: refresh page (#7661)

feature/windows-fix-syntax-2
Emily Grace Seville 2022-01-27 13:08:33 -08:00 committed by GitHub
parent 3a104d8676
commit 684f7bbc65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 29 deletions

View File

@ -1,12 +1,13 @@
# users # users
> Display a list of logged in users. > Display a list of logged in users.
> See also: `useradd`, `userdel`, `usermod`.
> More information: <https://www.gnu.org/software/coreutils/users>. > More information: <https://www.gnu.org/software/coreutils/users>.
- Display a list of logged in users: - Print logged in usernames:
`users` `users`
- Display a list of logged in users according to a specific file: - Print logged in usernames according to a given file:
`users {{/var/log/wmtp}}` `users {{/var/log/wmtp}}`

View File

@ -1,24 +1,33 @@
# useradd # useradd
> Create a new user. > Create a new user.
> See also: `users`, `userdel`, `usermod`.
> More information: <https://manned.org/useradd>. > 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}}`

View File

@ -1,21 +1,17 @@
# userdel # userdel
> Remove a user account or remove a user from a group. > 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>. > More information: <https://manned.org/userdel>.
- Remove a user: - Remove a user:
`userdel {{name}}` `sudo userdel {{username}}`
- Remove a user along with their home directory and mail spool:
`userdel --remove {{name}}`
- Remove a user from a group:
`userdel {{name}} {{group}}`
- Remove a user in other root directory: - 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}}`

View File

@ -1,16 +1,25 @@
# usermod # usermod
> Modifies a user account. > Modifies a user account.
> See also: `users`, `useradd`, `userdel`.
> More information: <https://manned.org/usermod>. > 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}}`