LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   FTP from a web browser (https://www.linuxquestions.org/questions/linux-newbie-8/ftp-from-a-web-browser-4175456354/)

DavidDiepUSC 04-01-2013 06:20 AM

FTP from a web browser
 
Hi Linux gurus,

I have set up a web browser and I would like to add an ftp hyperlink to a couple of directories. As of right now, I can only do this for /var/ftp/pub, where do I go to add other directories?

So far, I am able to put this in my web browser and it'll display the directory and anyone can download anything they want:

ftp://<ip address>/pub

Now I want them to access a directory that is not under /var/ftp/

Thanks for all your help!

DavidDiepUSC 04-01-2013 06:23 AM

Sorry.. this is what I'm running:

RHEL 6.2 (Santiago)
Linux version 2.6.32-220.el6
gcc version 4.4.5 20110214 (Red Hat 4.4.5-6) (GCC)

Madhu Desai 04-01-2013 06:47 AM

Allowing FTP Access to Files Outside the Home Directory Chroot

eklavya 04-01-2013 09:45 AM

Quote:

Originally Posted by DavidDiepUSC (Post 4922649)

I have set up a web browser

You mean a web server?

Are you using vsftpd?

Give proper permission to parent directory so no one can open them. It will show access forbidden error.

OR

Put a filename index.html in your all parent directories so no one can see the content of the directories.

DavidDiepUSC 04-01-2013 10:54 AM

eklavya,

My apologies... yes, a webserver.

Yes, I am using vsftpd.

I'm not sure what you mean... I want everyone to have access to be able to see everything under directories that I list. For example, if I provide a link on my website:

ftp://<ip address>/videos
and
ftp://<ip address>/pictures

What do I need to do to add these directories so that they can be accessible? /stuff/videos and /stuff/pictures

Right now /var/ftp/pub is the only directory available...

DavidDiepUSC 04-01-2013 11:01 AM

I can create two folders: /var/ftp/pub/videos and /var/ftp/pub/pictures and dump the contents from /stuff/videos and /stuff/pictures, but I was wondering if there was a file that I could update to simply add /stuff to.

Maybe its not available?

Madhu Desai 04-01-2013 11:14 AM

Quote:

Originally Posted by DavidDiepUSC (Post 4922842)
I can create two folders: /var/ftp/pub/videos and /var/ftp/pub/pictures and dump the contents from /stuff/videos and /stuff/pictures, but I was wondering if there was a file that I could update to simply add /stuff to.

Maybe its not available?

I think you didn't see the link i provided.
  1. Create directories /var/ftp/pub/videos and /var/ftp/pub/pictures
  2. bind the original directories to above path
  3. mount --bind <original-video-directory> /var/ftp/pub/videos
  4. mount --bind <original-pictures-directory> /var/ftp/pub/pictures

To make them permanent, add them in fstab

DavidDiepUSC 04-01-2013 11:16 AM

Sorry mddesai,

I did see them, but I wanted to avoid bind mounts... maybe its the only way :-/

Madhu Desai 04-01-2013 11:24 AM

Quote:

Originally Posted by DavidDiepUSC (Post 4922850)
avoid bind mounts...

What's wrong with bind mounts :scratch: are there any security issues? cause i'm using bind mounts. if there are any disadvantages, then i want to remove them.

DavidDiepUSC 04-01-2013 11:49 AM

Oh, no... don't get me wrong. I use them too.

I just was wondering if there was a .conf file somewhere that I didn't know about that I could specify what directories I want ftp access to. Thats all. Bind mounts are fine... I have updated my fstab to add the following:

# Bind Mounts for odcdocs FTP access
/Userguides/videos /var/ftp/pub/videos none bind 0 0
/Userguides/pictures /var/ftp/pub/pictures none bind 0 0

Thanks for your input with this...

Madhu Desai 04-01-2013 11:55 AM

Quote:

Originally Posted by DavidDiepUSC (Post 4922871)

Oh, no... don't get me wrong. I use them too.

Bind mounts are fine...

Thanks for your input with this...

Cheers...:)


All times are GMT -5. The time now is 07:47 PM.