www.mamboteam.com
macsat.com - OpenWrt | Olegs Firmware  
Home arrow Tutorials - OpenWrt (White Russian) arrow FTP Server
Saturday, 06 September 2008
 
 
Main Menu
Home
About
News
Tutorials - OpenWrt (WR)
Tutorials - Oleg
Wiki (RDC Based Routers)
Online Shop
Forum
Downloads
Free Linux eBooks
Links
Search
Contact Us
We have 6 guests online
2616658 Visitors
Login
Welcome Guest.






Lost Password?
No account yet? Register
Old macsat.com
Nokia Unlock (Dansk)
Nokia Unlock (English)
XBins IRC Chat
FTP Server PDF Print E-mail
(1 vote)
Written by macsat   
Thursday, 26 January 2006

 

This Tutorial will guide you through installing two different FTP servers on your OpenWRT box. The first one is a sftp server (secure ftp) - which uses an encrypted ssh connection to transfer your files. The second is a "normal" FTP server, in this case VSFTPD is chosen. 

Which server to install is upto the user. My experience tells me that the non-secure (vsftpd) server performs a bit faster than the stfpd one on my OpenWrt box. A good choice would probably be to allow normal FTP connections from the LAN, and only allow sftp connections from WAN - meaning that you will then have to install both servers.

The tutorial is based upon using OpenWrt WhiteRussian RC4 or later!

Index


1) Installing sftpd
2) Installing vsftpd

Installing sftpd

The sftpd server we are using is a part of the "standard" repository for WhiteRussian and hence installing is easy:

ipkg install openssh-sftp-server

That's it. You should now be able to login to your router using any sftp client using the same user/pass combination that you are using for ssh. Since sftpd can be seen as a "wrapper" around the ssh protocol, there is no need to open further ports in the firewall (taking for granted that your ssh port - port 22/tcp - is open).

Popular sftp clients include:
putty's psftp client - both Windows / Linux / *nix command line client.
winscp - windows GUI client
filezilla - Windows GUI Client
gFTP - Linux GUI Client

Installing vsftpd

Despite the name vsftp (Very Secure FTP Server) this ftp server is a "normal" ftp server and NOT a sftp server. This means that it uses the normal ftp protocol, and per default listens to connections on port 21.

Installing is simply done by:

ipkg install vsftpd

This will install the files /etc/vsftpd.conf which is the configuration file, and /etc/init.d/vsftpd which is the startup file (it also installs the binary in /usr/sbin/).
To make vsftpd startup at boot, you can make a symlink to the startup file like this:


ln -s /etc/init.d/vsftpd /etc/init.d/S50vsftpd

The standard config file will make vsftp work fine, and the "root" user logs into /tmp as default. To change settings take a look in the file, or check out the vsftpd.conf man page.

To access the ftp server from the LAN side, you have to make the following addition to your /etc/firewall.user just below: "### Allow SSH on the WAN interface" :
iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 21 -j ACCEPT
iptables        -A input_rule      -i $WAN -p tcp --dport 21 -j ACCEPT

This should be it!

Comments and questions are welcom at the forums.

Last Updated ( Thursday, 26 January 2006 )
 
< Prev   Next >
Buy Router
Linksys Wireless-N Broadband Router WRT300N
Linksys Wireless-N Broadband Router WRT300N
Recent Forum Topics
Donations

If you appriciate this site, please consider making a small donation.

All donations will be used to cover expenses from running macsat.com.

Sponsored Ads
 
Top! Top!