1

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
Jonathan Solorzano
  • 201
  • 1
  • 3
  • 12
  • I 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 – Jacob Evans Oct 26 '15 at 02:05
  • Oh, 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 – Jonathan Solorzano Oct 26 '15 at 02:08

1 Answers1

2

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.

Ryan Babchishin
  • 6,160
  • 2
  • 16
  • 36