Change default home dir of user
6,020
I have no idea why usermod doesn't work but it doesn't really matter. You can easily review & edit /etc/passwd
and make the necessary change if required. Then move their existing home directory over to /var/www/project/ if desired.
Related videos on Youtube
![Jonathan Solorzano](https://i.stack.imgur.com/R8Jav.jpg?s=256&g=1)
Author by
Jonathan Solorzano
Updated on September 18, 2022Comments
-
Jonathan Solorzano almost 2 years
I want to change the default home directory of a user from this:
User: john Default home: /home/john
To this:
User: john Home: /var/www/project/new-home
How could i do that?
What i've tried so far is use usermod:
usermod -m -d /var/www/project/john john
It worked for one user, but i've got two users, john & sarah, and when i tried the same for sarah it said:
usermod: no changes
-
Jacob Evans over 8 yearsI understand why you might want to do that, but you should just put the website under /home/username/html or public_html, this is how cpanel and interworx (and likely others) separate userspace, also check out SuexecUserGroup
-
Jonathan Solorzano over 8 yearsOh, no that's not what i want to do, i'm using pure-ftpd and it's configured to chroot users to their home dir, so basically one user is for the frontend files, and the other is for the backend files, i just want the users to navigate through their files, not to be able to navigate upper their dir @JacobEvans
-