# ftpd and Web Browser



## kjemison (Apr 8, 2011)

Hello,

I have a fresh install of FreeBSD 8.1 and I am experimenting with the ftpd service. Very simple to activate and I can connect via FileZilla with no problems. However, I am wondering if it is possible to connect using a browser like IE or Firefox? Do I have to install Apache or??

Thank you
Kell


----------



## SirDice (Apr 8, 2011)

Most browsers support the ftp protocol, no need to install a web server. Just use an URI like ftp://www.example.com/.


----------



## kjemison (Apr 8, 2011)

Thank you SirDice ... I will give it a try.


----------



## shitson (Apr 8, 2011)

You can also put your login details in there too *ftp://username:password@hostname/* so it won't prompt for these, Just remember to clear them from your history. 

The only limitation with using a browser is they normally don't support a full blown ftp client, you wont be able to upload or do any of the typical directory functions. Just the ability to GET files.


----------



## SirDice (Apr 8, 2011)

shitson said:
			
		

> You can also through your login details in there too *ftp://username:password@hostname/* so it wont prompt for these


Several browsers, Internet Explorer for instance, don't accept that form anymore.

People got confused with URIs like ftp://www.microsoft.com@www.example.com/. And as such it was heavily abused by spammers and phishers.


----------



## Beastie (Apr 8, 2011)

You can use the IP address, e.g. for a local network FTP server *ftp://192.168.1.17*.

Instead of a web browser or the *FileZilla client* you can also use the ftp clients available in virtually every system (see ftp(1) for FreeBSD's). It's as simple as:

```
% [highlight]ftp 192.168.1.17[/highlight]
[...]
Name (...): [highlight]anonymous[/highlight]
[...]
Password: [highlight]<enter>[/highlight]
[...]
ftp> [highlight]lcd [file]path/to/local/directory[/file][/highlight]
ftp> [highlight]cd [file]path/to/remote/directory[/file][/highlight]
ftp> [highlight]ls[/highlight]
[...]
ftp> [highlight]get file.txt[/highlight]
[...]
ftp> [highlight]bye[/highlight]
```


----------



## kjemison (Apr 8, 2011)

I appreciate all the input so far... very much appreciated! 

My project for my customer is as follows:

They are general contractors and they are constantly getting email requests for permiting plans etc that are in PDF form. The general contractor was looking for a solution for the sub's to be able to get it themselves... So, I thought that a simple "Read Only" FTP server would work for them. Of course the I would need the easiest way for the sub's to connect to the FTP server and I do not think they would understand something like FileZilla.  I wanted them to be able to click on a link that would take them to the server since most people know how to just click on a link. 

I did manage to get IE 8 to login but only with syntax: ftp://user:password@IPaddress
When this works... It displays all of the other directories on the server .. not just the /home directory. Wish it would not do that!

I would like to have them "locked" into a directory and was thinking about chroot as an option.? 

Any thoughts or ideas would be appreciated.


----------



## Beastie (Apr 8, 2011)

Setup an anonymous user whose home page is the intended FTP server's root directory. Web browsers usually "understand" these anonymous FTP accounts and automatically login using bogus email addresses (or blank lines?) as password.

Everything within the FTP directory must be readable by the World and writable only by root (e.g. 755), and chowned to root. Whatever you do, never chown anything to the FTP user!

You can also install and use an FTP server other than ftpd if you want.


----------



## kjemison (Apr 9, 2011)

Thank you for the reply Beastie!

I went through the ports collection on my system and decided to install vsftpd. I do like the fact that the .conf file seems much more complete than the options I had with the "out of the box" ftp service. I will keep you posted on my progress.

Kell


----------



## Beastie (Apr 9, 2011)

Note that you can start ftpd with some options by overriding *ftpd_flags="-FLAGS"* in /etc/rc.conf.

Good luck with your setup.


----------



## kjemison (Apr 10, 2011)

I ended up installing pure-ftpd and it is working great! 

Beastie, I appreciate the tips on locking down the directory


> Setup an anonymous user whose home page is the intended FTP server's root directory. Web browsers usually "understand" these anonymous FTP accounts and automatically login using bogus email addresses (or blank lines?) as password.
> 
> Everything within the FTP directory must be readable by the World and writable only by root (e.g. 755), and chowned to root. Whatever you do, never chown anything to the FTP user!



Thanks again!
Kell


----------

