tldr/pages/linux/usermod.md

17 lines
364 B
Markdown
Raw Normal View History

2014-03-24 10:31:06 +00:00
# usermod
> Modifies a user account.
> More information: <https://manned.org/usermod>.
2014-03-24 10:31:06 +00:00
- Change a user's name:
2014-03-24 10:31:06 +00:00
`usermod -l {{newname}} {{user}}`
- Add user to supplementary groups (mind the whitespace):
2014-03-24 10:31:06 +00:00
`usermod -a -G {{group1,group2}} {{user}}`
- Create a new home directory for a user and move their files to it:
2014-03-24 10:31:06 +00:00
`usermod -m -d {{path/to/home}} {{user}}`