PDA

View Full Version : create a user in a second HD



winger
01-17-2010, 10:32 AM
hello,

how can I create a user account in a second hard disk?

I've found some informations in how to change the /home location but none in how to setup only one aco**** in another HD.

any help?

thanks!

nobaloney
01-17-2010, 10:47 AM
1) Change it.

2) Set up the new account.

3) Change it back.

Jeff

winger
01-17-2010, 11:07 AM
Jeff,

and this is the best way? http://help.directadmin.com/item.php?id=291

thanks!

winger
01-17-2010, 11:15 AM
just change at /etc/default/useradd and it is working!

thanks :D

nobaloney
01-18-2010, 11:17 AM
and this is the best way? http://help.directadmin.com/item.php?id=291
No, this won't do it at all, this is for moving the entire /home directory to another hard disk or partition.

just change at /etc/default/useradd and it is working
Does this also change the path in the user-level httpd.conf file?

Jeff

winger
01-18-2010, 11:27 AM
are you talking about the /etc/httpd/conf/extra/ httpd-userdir.conf file?

if yes, I don't think so:

<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit Indexes
Options -MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

nobaloney
01-18-2010, 11:57 AM
Then it's not all you have to do to solve the problem.

Jeff

fesite
06-21-2010, 10:04 PM
I have the same question, users in two HD.

Spamassassin
06-21-2010, 10:42 PM
Just creat the user normally through DA .. and then create a symbolic link to point the home directory of the user to another folder in the 2nd HDD with same permissions.

I use this why all the time and it's very easy and helpful

Peter Laws
06-22-2010, 12:38 AM
There's a post on how to add extra HD's for new user's data (round-robin mannor), but I can't find it!

localhost
06-23-2010, 02:56 PM
People what's wrong with you ? :)

How to do it in 5 easy steps:
1. create the user in /home/demouser
2. cp -r /home/demouser /hdd2/../..
3. Delete /home/demouser
4. ln -s /hdd2/path-to-demouser /home/demouser
5. Enable Quota on /hdd2/

floyd
06-23-2010, 03:12 PM
Change user’s home directory
mkdir /home2/username # home2 being the second hard drive.
(cd /home/username;tar cf - *) | ( cd /home2/username; tar xfp -)
usermod -d /home2/username username
echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue

Reference from DirectAdmin Support http://www.directadmin.com/forum/showthread.php?p=182533

nobaloney
06-24-2010, 09:09 AM
Does this manage mail properly as well? Johns post, back in 2003, was written before mail was stored in /home.

Someone needs to check and let us know, because /home is hardcoded in exim.conf and I don't see an easy way to change that.

Jeff

localhost
06-24-2010, 01:18 PM
Does this manage mail properly as well? Johns post, back in 2003, was written before mail was stored in /home.

Someone needs to check and let us know, because /home is hardcoded in exim.conf and I don't see an easy way to change that.

Jeff
Stop trolololo, I just wrote in #11 how to do it. I also had couple of years ago one server and made the same as described in #11.

floyd
06-24-2010, 01:29 PM
I just wrote in #11 how to do it.

And I wrote in post #12 another way to do it. Post #12 is based on the suggested method by the DirectAdmin staff. It is also my opinion that it is the better way to do it rather than faking it. Both ways are valid.

I don't know what trolololo is.

localhost
06-24-2010, 01:32 PM
And I wrote in post #12 another way to do it. Post #12 is based on the suggested method by the DirectAdmin staff. It is also my opinion that it is the better way to do it rather than faking it. Both ways are valid.

I don't know what trolololo is.
LOL :) What do you mean be faking? You should read more about inodes and filesystems. No offence but your another way will not work normaly because of:

Someone needs to check and let us know, because /home is hardcoded in exim.conf and I don't see an easy way to change that.
And as I remember EXIM is not the only /home hardcoded thing. There are more.

floyd
06-24-2010, 01:46 PM
What I mean by faking it is using the symbolic link. Some things will not follow symbolic links in certain situations.

Exim is a fair point and why Jeff brought it up. However they should not be hardcode that way. In my opinion that is wrong. Any application that uses the user's home directory should query the file (CentOS is /etc/passwd) that specifies what the user's home directory actually is.

But even if I am wrong about stuff that is no reason to act like I am stupid.

localhost
06-24-2010, 01:54 PM
Some things will not follow symbolic links in certain situations.

Some examples please ? :) You should read about inodes and sylinks (http://en.wikipedia.org/wiki/Symbolic_link).


Any application that uses the user's home directory should query the file (CentOS is /etc/passwd) that specifies what the user's home directory actually is.
Agree.

floyd
06-24-2010, 02:03 PM
You should read about inodes and sylinks

Is there an echo in here?

I am sorry I cannot remember specific examples. Symlinks work for most things but I do know I have experiences where symlinks did not work. I do use symlinks but when I have a problem I know where to look first.

Large hard drives are so cheap now I do not even know why we have this thread. Just replace the hard drive and leave everybody's home directory under /home.

floyd
06-24-2010, 02:05 PM
Just thought of one. tar the /home directory and instead of the users data on the second hard drive you will end up with just the symbolic link.

localhost
06-24-2010, 02:08 PM
Just replace the hard drive and leave everybody's home directory under /home.
That's downtime.


Symlinks work for most things but I do know I have experiences where symlinks did not work.
How come if it's the same INODE? You are just trolololololing... If it's the same INODE the system doesn't know if this is a folder or symlink.

floyd
06-24-2010, 02:25 PM
You are just trolololololing...

You keep using that word after I have told you I don't know what it means. I feel I am being insulted but I am not sure.

I or the community have nothing to gain by continuing with this. :p

localhost
06-24-2010, 02:28 PM
You keep using that word after I have told you I don't know what it means.

This is trololo: http://www.youtube.com/watch?v=oavMtUWDBTM&feature=related

nobaloney
06-25-2010, 08:46 AM
@floyd:

According to man tar on both Redhat/CentOS and Debian/Ubunut distributions (I just checked) you can use the -h or --dereference options to treat symlinks by following them and archiving/restoring them as if they were real.

The program I remember as not following symlinks is apache, but it depends on an option in the configuration. You can not follow symlinks, follow them, or only follow them if the owner matches. Lots of Google hits here (http://www.google.com/#hl=en&source=hp&q=apache+follow+symlinks).

Everyone:

Exim delivers email based on where it is. /home just happens to be where it is when using Dovecot on DirectAdmin. That part of the code that's hard-coded was written by DirectAdmin staff. I've just found a reference in my current RC (and maybe in all exim.conf files in use by DirectAdmin; I haven't checked), to $home, in the userforward director.

So it may very well work. However recently I believe someone has posted on these forums that the forwards in the .forward file weren't working. Are they? If they are, then $home can possibly be substituted for /home in the local_delivery director.

However I'm not sure what exactly $home contains at the point where it needs to be checked.

Documentation is here (http://www.exim.org/exim-html-3.20/doc/html/spec_24.html#SEC652) (exim.org). Anyone have time to check it?

Jeff

polo
09-03-2010, 08:04 AM
I have some users that was moved to a second hard drive mounted as home2

mail works and everythign is great except ftp. I cannot add or modify ftp users it says :

Cannot Execute Your Request



Details

That is not a valid path. Either it is not in your home directory, it doesn't exist, it contains symbolic links, or it contains invalid characters



Any Ideas????????? :)

DirectAdmin Support
09-05-2010, 04:15 PM
Hello,

That error message is generated when DA checks the ftp path for custom accounts. It's looking for a few things (which can generate that message).

1) Check /etc/passwd for the system account. Make sure the home path is /home2/username, if the user is under /home2.

2) There also cannot be any symbolic links in the path. No directories can be present in any part of the path.

3) the path must exist, and be chowned to the User. (root won't be allowed)

4) it must be a valid path (obviously).. must start with the / character, and end with the name of the directory it's pointed to.

5) The path must be below the home directory of the User, so similar to check #1, the path would need to be something like /home2/user/path, or /home2/user/some/other/path, etc...


On a side note (not related to the ftp issue), regarding quotas and 2nd drives:
http://www.directadmin.com/features.php?id=611

John

Seth
07-10-2011, 04:21 PM
So what is the best way to do this? I have /home2 and /home3 I would like to use.

nobaloney
07-20-2011, 10:24 AM
If I recall correctly, you just change DirectAdmin to use /home2, and it will create new users in /home2 but users created earlier won't be affected. And when /home2 is full, do the same, moving to /home3.

Jeff