Changing user homedir

alpha

Verified User
Joined
Dec 21, 2003
Messages
30
Does DA utilize /usr/sbin/adduser to create accounts?

I've edited /etc/adduser.conf so that the home directory is created in /usr/home instead of the default [/home].

Whenever I use adduser command to create a user, it creates the homedir under /usr/home/ like its supposed to... however, whenever I create a user with DA, it still creates it under /home/

Any information on this?
 
I would recommend creating a symlink for /usr/home to /home, unless you needed both /usr/home and /home to be separate. I'm not sure if you could make such a change in DA without having to change it for each version.
 
Hm, yes - that would work; however, the reason why I was asking this was because of this thread I found:

http://www.directadmin.com/forum/showthread.php?s=&threadid=1590&highlight=home+directory

In there John states that DA uses the system itself to figure out the default home directory. Let's say if your primary drive is full and you need to add on another drive to become /home2 - You shouldn't have move everything from /home to /home2 and symlink. All you should have to do is switch the default home directory prefix to /home2 so that all new accounts are created in /home2 instead of /home

It seems in the thread linked above, DA utilizes /usr/sbin/adduser to create accounts - if this was a case for FreeBSD 5.1 then if I can manually use adduser to create a user and also place their home directory under /usr/home - then DA's account creation should follow suit. It appears that DA utilizes some other account creating function and I'd like to know how to go about getting this done.
 
Hello,

For FreeBSD, the following command is used:
Code:
/usr/sbin/pw useradd -n username -s /sbin/nologin -w no -h 0 -m
(password sent on stdinput).

To create the "default" configuration file with a new "home", I believe (untested) that you just run:
Code:
pw useradd -D -m -b /home2
The -D is the important part the tells pw to create the default file. You can type "man pw" for more info on how to set this up.

John
 
Back
Top