Creating a home directory for a user
17,413
mkdir /home/brinst
usermod -d /home/brinst brinst
More cleaner way:
mkhomedir_helper brinst
![Oussema Benlagha](https://lh3.googleusercontent.com/-i8evMS2CT5I/AAAAAAAAAAI/AAAAAAAAADU/h6HrFngsVtk/photo.jpg?sz=256)
Author by
Oussema Benlagha
BY-DAY: Intern engineering student in cloud computing firm BY-NIGHT: freenlancer in many fields
Updated on June 29, 2022Comments
-
Oussema Benlagha almost 2 years
Hi I added a user using useradd command so that he have no home directory:
useradd -M -u 1110 brinst
Then I wanted too add a home directory for the same user using usermod but that didn't work out:
usermod -m -d /home/lagha brinst usermod: no changes
How can I create a home directory with all it's folders and hidden files for this user when he doesn't have an old one? - that seems to be easy but somehow it's not working.