1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 13:02:08 +02:00
tldr/pages/linux/usermod.md
Lena c9775847b6
pages/*: use the imperative in descriptions (#12574)
* pages/*: use the imperative in descriptions

* go-fmt: put the description on one line
2024-04-18 09:34:00 +05:30

587 B

usermod

Modify 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}}