mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-10 20:47:03 +00:00
Update cheatsheets
This commit is contained in:
30
linux/usermod
Normal file
30
linux/usermod
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# usermod
|
||||
|
||||
> Modifies a user account.
|
||||
> See also: `users`, `useradd`, `userdel`.
|
||||
> More information: <https://manned.org/usermod>.
|
||||
|
||||
- Change a username:
|
||||
|
||||
`sudo usermod --login {{new_username}} {{username}}`
|
||||
|
||||
- Change a user id:
|
||||
|
||||
`sudo usermod --uid {{id}} {{username}}`
|
||||
|
||||
- Change a user shell:
|
||||
|
||||
`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