Support several customers on same linux box
Hi guys, I'm a Linux newbie, trying to make the leap from Micro$oft to Linux.
I'm setting up a new linux box to give email and web services to some small companies I manage. I'd like to secure things up a bit, as I don't want that user in Company A be able to access Company B data. For starters I'm planning to create a new place for placing users, groups, files and some other Company related stuff. I'm thinking about creating a folder structure like this: /customers/companyX/users /customers/companyX/users/mail /customers/companyX/files and so on... I want to be able, when I add a user for some company, that the user home dir will be set to /customers/companyX/users/userX Question 1: is this folder structure ok, or is there a better,safer place to put it other than / ? Question 2: how can I set a new user home dir to the path above, when I add it? Similarly, how can I set the email location? Many thanks! |
first of all, i see this is your first post, welcome to lq
i will answer question 2 first i would look at the man page for useradd there is an option to set the base path and the home dir of the user as it's being created you could also create the user and then change the home directory entry in the file /etc/passwd, but i wouldn't recommend this, i would recommend creating the user with the defined home directory rather than changing the home directory after the fact. as for question 1 no i don't see anything wrong with the home directory structure you proposed, the beauty of linux is that you can do that and you aren't stuck with '/home/user' like windows sticks you with 'documents and settings/user' |
I think you can change the base home directory that will be created for a new user by editing /etc/default/useradd
mine has Code:
HOME=/home |
Quote:
|
As frieza said, useradd has the ability to explicitly specify the home dir (specifically -d ); I wouldn't bother messing with the defaults file.
http://linux.die.net/man/8/useradd |
All times are GMT -5. The time now is 06:38 PM. |