Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 06-08-2011, 05:59 PM   #1
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:
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
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
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,233

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
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
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
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,577
Blog Entries: 31

Rep: Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196
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
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.10, Centos 7.5
Posts: 17,677

Rep: Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487
As frieza said, useradd has the ability to explicitly specify the home dir (specifically -d ); I wouldn't bother messing with the defaults file.


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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:16 AM.

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