LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   FTP exclusive directory access (https://www.linuxquestions.org/questions/linux-general-1/ftp-exclusive-directory-access-19999/)

allancondino 05-02-2002 02:29 AM

FTP exclusive directory access
 
Hi,

I have a RH 6.2 running. I have created a directory /home/httpd/webpage where i have my web files.

I use the command chown webmaster.webmaster /home/httpd/webpage to change ownership of the directory.

But when i FTP to this directory using user webmaster i am only allowed for read-only.

Any help on how i can setup my webpage directory to be exclusive for user webmaster with read-write persmission?

Mik 05-02-2002 02:46 AM

To give the user write permissions on the filesystem level use the following command:
chmod u+w /home/httpd/webpage

I don't know which ftp server but with some there are extra directives in the ftp configuration files to block writes in certain directories. But you should be able to find more about that in the documentation of the ftp server you are using.

allancondino 05-02-2002 03:02 AM

exclusive for a specific directory
 
Hi Mik,

Thanks for prompt reply. I think the command will work with my RH 6.2. I actually use the chown instead to change ownership thus completely giving write access to my webmaster user.

But one more thing. Hope it's not too much to ask. How can i setup the 'webmaster' FTP access exclusively accessing my /home/httpd/webpage directory. Meaning, when the user use the FTP client, the user can only see /. User should not be able to see other files or directories except /home/httpd/webpage files and it's subdirectories.

Thanks again.

Mik 05-02-2002 06:15 AM

The chown just changes the owner of the file. When you specify chown user.user filename. Then you change the user and group. The chmod command is used to change permissions for either user, group or other (ugo). So the command chmod u+w would give the user permission to write. But you should read the man pages on chown and chmod to understand exactly how they work.

Usually the best way would be to use a chroot jail. I don't know which ftp server you are using. But the most popular ftp servers have documentation on how to get this done.
Proftpd does it using a DefaultRoot derictive which doesn't offer as much security as a chroot jail but it makes setting the process up a lot easier and for most people this is enough.


All times are GMT -5. The time now is 05:10 PM.