tldr/pages/linux/usermod.md

26 lines
589 B
Markdown
Raw Normal View History

2014-03-24 10:31:06 +00:00
# usermod
> Modifies a user account.
> See also: `users`, `useradd`, `userdel`.
> More information: <https://manned.org/usermod>.
2014-03-24 10:31:06 +00:00
- Change a username:
2014-03-24 10:31:06 +00:00
`sudo usermod --login {{new_username}} {{username}}`
2014-03-24 10:31:06 +00:00
- Change a user id:
2014-03-24 10:31:06 +00:00
`sudo usermod --uid {{id}} {{username}}`
2014-03-24 10:31:06 +00:00
- Change a user shell:
2014-03-24 10:31:06 +00:00
`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}}`