LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 09-13-2002, 08:50 AM   #1
petey
LQ Newbie
 
Registered: Apr 2002
Posts: 8

Rep: Reputation: 0
User Accounts


Currently my FREBSD box has a single user account that I use to telnet into an then su to root to do administrative tasks.

I'm hosting a lot of websites and am now looking into giving ftp access for users to their directory. What I have it this

/usr/local/www

from here are each domain I host, so each users directory is in this www directory.

Every directory in the www directory has 755 permissions. I have created a test account and set the user's home directory to

/usr/local/www/whatever.com/newuser

/usr/local/www/whatever.com/ has 755 permissions and is owned by newuser and group newuser

The rest of the directories in www are owned by my original login account so one directory would look like this

drwxr-xr-x 11 mark mark 1024 Aug 19 17:09 residenceperfection.com

I FTP'd in under the new user and it brought me to /usr/local/www/whatever.com/newuser like I wanted, but I was able to change directories to /usr/local/www/ and even able to goto /usr/local/www/residenceperfection.com under the new user and download files. Now access is denied for uploading into these directories, but you can see the issue. A user could potentially download another client's website, or even worse config files for logging into their admin page with username's/passwords etc.

What I want to do is allow the user access to only their directory

(ie) /usr/local/www/whatever.com/newuser

and not be able to cd to /usr/local/www or at least not be able to access /usr/local/www/someoneelseessite.com

Is it just a permissions thing?? What should they be for /usr/local/www and /usr/local/www/sitename.com? (provided sitename.com is owned and in a diffrent group) Can I set the permissions low enough to where another user can't see it, but it doesn't effect if a web user can access the page?

Thanks!!

Petey
 
Old 09-13-2002, 09:05 AM   #2
sandy
Member
 
Registered: Aug 2002
Location: Mumbai,India
Distribution: Linux Mint 12, Gentoo
Posts: 230

Rep: Reputation: 30
Re: User Accounts

drwxr-xr-x 11 mark mark 1024 Aug 19 17:09 residenceperfection.com
This line indiates that every user in the system has read permisions but they dont have write pemissions.
Thats why they can download files but cant upload files ( to upload files into a directory one needs write perms for that directory)

I think the possible solution is to change the permisions of all directories to 700
 
Old 09-13-2002, 09:20 AM   #3
petey
LQ Newbie
 
Registered: Apr 2002
Posts: 8

Original Poster
Rep: Reputation: 0
700 gives an Permission Denied on the web page, but setting the permissions to 711 or drwx--x--x gives access to the webpage, but denies access for other logins..

Thanks Sandy

Petey
 
Old 09-17-2002, 02:45 PM   #4
elmore
LQ Newbie
 
Registered: Aug 2002
Location: Atlanta
Posts: 9

Rep: Reputation: 0
Here's what I do with my server, I setup ftp account for other users but I only allow them access to their home directory. In their home I create a www folder, and then a folder for each domain name they use. For instance user 1 has two domains I host for him. I allow him chrooted ftp access to his home dir. so you have globally

Quote:
/home/user1/www/domain1/
/home/user1/www/domain2/
/home/user2/www/domain1/
so on and so forth, from there you'll just need to configure apache for virtual domains and set the document root for each domain to be

Quote:
/home/user1/www/domain1
without the slash.

if your allowing space off a main domain or doing sub-domains you could include external directories from the document root and point to the users home in apache or you could do this a symbolic link where

Quote:
/usr/local/www/user1 -> /home/user1/www/webpage
Hope this helps.
 
Old 09-26-2002, 09:28 AM   #5
c0rk3y
Member
 
Registered: Apr 2002
Location: NY USA
Distribution: Gentoo1.4/ FreeBSD4.x
Posts: 78

Rep: Reputation: 15
Which ftp did you choose?

People have failed to ask which ftp service is being used

proFTPd or wu-ftpd

I would choose proFTPd it has an easier configuration.
f you are using proftp, try adding the line below in your /etc/proftpd.conf file:

DefaultRoot ~

That should set the users home directory to be the root of the file system for them to use. Also, they can only access other areas if the permissions are set to allow the request for the world. Or a group if they are assigned to the group. When you create the user/group set the home directory to there domain.


Also hopefully you just didnt uncomment out the port.

Here is a good site that has good refference

Guide The page is well done I used it as a refernce for Samba and my proFTpd. works very well and easy to understand
 
  


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
User Accounts Cool_Hand_Luke Linux - Newbie 6 08-24-2005 08:35 PM
user accounts metallica1973 Linux - Security 2 06-19-2005 05:35 PM
User Accounts kaplan71 Linux - General 1 07-08-2004 01:19 PM
User Accounts MrJoshua Linux - General 3 01-10-2003 08:30 AM
User Accounts afair Linux - Newbie 3 09-19-2002 12:57 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 12:45 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