Google Answers Logo
View Question
 
Q: Apache Users/Groups FTP Access ( Answered 4 out of 5 stars,   0 Comments )
Question  
Subject: Apache Users/Groups FTP Access
Category: Computers > Internet
Asked by: jk01-ga
List Price: $10.00
Posted: 27 Aug 2002 22:45 PDT
Expires: 26 Sep 2002 22:45 PDT
Question ID: 59311
I will try to make this as detailed as possible.
I have a dedicated server and I am not that familiar with Apache.

I am having trouble creating a directory in my /www/ (where all of my
domains are) folder and then having upload access to this directory
with my FTP client.

I am using a program called 'Webmin' <http://www.webmin.com> which was
installed by my hosting provider.

I beleive this has something (or everything) to do with users and/or
groups, although I have no idea what I am looking for and the Apache
online docs are really just jibberish to me.

My question is, what file(s) do I have to edit in order to give a
particular user FTP upload access to a specific directory. And what
exactly do I need to place in these files?
Answer  
Subject: Re: Apache Users/Groups FTP Access
Answered By: joseleon-ga on 28 Aug 2002 00:18 PDT
Rated:4 out of 5 stars
 
Hello:
  You are right when you say your problem has something (or
everything) to do with users and/or groups, but the problem is not in
Apache, is in filesystem permissions. When you create a new directory
on your server, you must take care of its permissions to prevent
unauthorized access. For what you say, I think you want to create a
directory on your server to allow an specific user to upload files on
it.

Check out the following sites to know all you need about file
permissions, users and groups:
    
What are File permissions?  
http://www.cs.bu.edu/help/unix/what_are_file_permissions.html

Linux Man Page: chmod
http://www.die.net/doc/linux/man/man1/chmod.1.html

Linux Man Page: chown
http://www.die.net/doc/linux/man/man1/chown.1.html

Linux Man Page: groupadd
http://www.oreillynet.com/linux/cmd/g/groupadd.html

Linux Man Page: useradd
http://www.oreillynet.com/linux/cmd/u/useradd.html

After you read all this information, you must perform the following
steps:

-Contact your hosting provider to know if your dedicated server runs
Telnet or SSH, SSH preferred.

OpenSSH
http://www.openssh.com/

If you want to use Windows to log into your server, you can use Putty:

PuTTY: A Free Win32 Telnet/SSH Client
http://www.chiark.greenend.org.uk/~sgtatham/putty/

-Log into your server with root account
-Add a group to your server using groupadd
-Add a user to your server using useradd
-Create your directory where you want
-Change user permissions of that directory to allow write only to the
owner.
 (this is the default behaviour, use ls -l to check for the current
permissions)
-Change the owner of that directory to the user you just created

This is a simple example of what you have to do:

tux:~# groupadd yourgroup
tux:~# useradd -g yourgroup youruser
tux:~# mkdir yourdir
tux:~# chown youruser:yourgroup yourdir

Of course, you must check all the options of all commands because you
might be interested to add more functionality (i.e. create a home
directory for the user)

There are another ways to do what you want, for example, using FTP,
but I think this is the better way because allows you to know what is
really happening behind the scenes.

What you can do with apache is restrict access to http files using
.htaccess files, but this has nothing to do with FTP, check out this
page to know more:

Using .htaccess Files with Apache
http://apache-server.com/tutorials/ATusing-htaccess.html

I hope this answer solves your question, and don't forget you can ask
for any clarification.

Best regards.
jk01-ga rated this answer:4 out of 5 stars
Thank you for such informative links, I think I am beginning to
understand Apache a little more clearly now. These are the simplest
instructions I've seen anywhere. Again, thanks you for your answer

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy