LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-08-2011, 05:59 PM   #1
LinuxGreen
LQ Newbie
 
Registered: Jun 2011
Posts: 3

Rep: Reputation: Disabled
Question 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!
 
Old 06-08-2011, 06:26 PM   #2
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,200

Rep: Reputation: 397Reputation: 397Reputation: 397Reputation: 397
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'

Last edited by frieza; 06-08-2011 at 06:30 PM.
 
Old 06-08-2011, 06:54 PM   #3
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
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
ie if I add a user derp his home folder will be /home/derp. In your situation I don't think it matters where the folders are, what you need to do is create a group for the users of the different companies and make sure that their home folder are not world readable. Likewise the mail spool. You could make /customers/companyX/files readable only by members of the companyX group and then people of companyY and Z wouldn't be able to read anything in there.
 
Old 06-09-2011, 01:23 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by frieza View Post
windows sticks you with 'documents and settings/user'
Unless you configure the user's profile (in the registry) differently.
 
Old 06-09-2011, 03:27 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux webserver with chat and voip on-line for support customers! daniel77 Linux - Software 0 04-07-2008 02:33 PM
LXer: 30 New Customers Sign up for Microsoft's Linux Support Coupons LXer Syndicated Linux News 0 11-09-2007 05:20 AM
SMC says Linux on box but not inside or via TECH SUPPORT suguru Linux - Networking 4 11-30-2005 07:36 PM
X-Box pad support in linux 2.6 kernel alzen Linux - Hardware 0 01-23-2005 09:23 PM


All times are GMT -5. The time now is 08:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration