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

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.