LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 04: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, 05: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,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
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 05:30 PM.
 
Old 06-08-2011, 05: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, 12:23 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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, 02:27 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

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



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 01:33 PM
LXer: 30 New Customers Sign up for Microsoft's Linux Support Coupons LXer Syndicated Linux News 0 11-09-2007 04:20 AM
SMC says Linux on box but not inside or via TECH SUPPORT suguru Linux - Networking 4 11-30-2005 06:36 PM
X-Box pad support in linux 2.6 kernel alzen Linux - Hardware 0 01-23-2005 08:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:11 AM.

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
Open Source Consulting | Domain Registration