作者:gzshun. 原创作品,转载请标明出处!
来源:http://blog.csdn.net/gzshun
在嵌入式Linux系统中,有时候需要搭建一个ftp服务器,以便windows或linux系统去访问嵌入式linux系统的数据。现在流行的ftp和vsftpd软件相对比较大,在嵌入式Linux系统下不太合适。最近由于需要,发现了一款很小型的ftp服务器,在这里分享。
stupid-ftpd点击下载
根据自己的需要,修改Makefile,将gcc修改为交叉工具链的gcc,比如mips-gnu-linux-gcc。若要静态编译,在CFLAGS后面添加"-static"选项。以下的Makefile已经修改:
#
#
# Makefile for the linux version of stupid-ftpd
#
#
#
CC=mips-linux-gnu-gcc -EL #修改
OBJS=ftpcommand.o ftpdconfig.o command.o ls.o stupid-ftpd.o
DOBJS=ftpcommand.do ftpdconfig.do command.do ls.do stupid-ftpd.do
POBJS=ftpcommand.po ftpdconfig.po command.po ls.po stupid-ftpd.po
LIBS=
CFLAGS=-O2 -Wall -Wstrict-prototypes -static #修改
DCFLAGS=-g -DDEBUG -Wall -Wstrict-prototypes
PCFLAGS=-g -DDEBUG -Wall -Wstrict-prototypes -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs
EXEC=stupid-ftpd.Linux6
.SUFFIXES: .c .o .do .po
all: $(OBJS)
$(CC) $(CFLAGS) -o $(EXEC) $(OBJS) $(LIBS)
debug: $(DOBJS)
$(CC) $(DCFLAGS) -o $(EXEC) $(DOBJS) $(LIBS)
pedantic: $(POBJS)
$(CC) $(PCFLAGS) -o $(EXEC) $(POBJS) $(LIBS)
clean:
rm -f $(OBJS) $(DOBJS) $(POBJS) $(EXEC) *~
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
.c.do:
$(CC) $(DCFLAGS) -c -o $@ $<
.c.po:
$(CC) $(PCFLAGS) -c -o $@ $<
install:
install -m 755 -s ./stupid-ftpd /usr/local/bin/stupid-ftpd
install -m 700 -d /etc/stupid-ftpd
install -m 755 -d /usr/local/stupid-ftpd
install -m 600 ./stupid-ftpd.conf /etc/stupid-ftpd/stupid-ftpd.conf
只需修改两个位置。
编译完成后,生成stupid-ftpd.Linux6可执行程序,该程序运行需要配置文件,以下的配置已经被修改并验证,是可以用的。但前提是运行在嵌入式Linux系统下,21端口没有被占用。
#
# This is a config-file for stupid-ftpd
# ------------------------------------
#
# The standard path should be /etc/stupid-ftpd.conf
# You can define other paths by using the "-f" option
# when starting stupid-ftpd.
#
#
# ATTENTION: 1) Remember, that the server is running with YOUR permissions.
# It will fail to access other users directory, unless it is
# root, but it also allows to access ALL YOUR directories,
# which are deeper in a user's root-dir and YOU HAVE access to.
# 2) To solve the problem, the best way is to define a group-ID
# for stupid-ftpd.
# Or if you aren't root: set the MAIN root (serverroot=) to
# the highest directory depth which is possible.
# 3) REMEMBER: DO NOT PUT THIS FILE in an accessible directory!!!
# There are passwords defined here. The safest place is
# outside the serverroot.
# Server operation mode:
# daemon - quiet in background
# interactive - standard mode
#mode=interactive #交互式的形式运行
mode=daemon #以守护进程的形式运行在后台
# chroot to
#serverroot=/usr/home/cinek/tmp3/aaa
serverroot=/mnt #将ftp的根目录设置为/mnt目录下,在windows打开该ftp,就能访问/mnt目录
# type of chroot
# real - kernel chroot(), high security, but needs root privileges
# virtual - no real chroot(), software side (virtual) chroot
#changeroottype=real
changeroottype=virtual
# Port number for the FTP-Protocol
#port=2121
port=21 #默认为ftp的端口号。
# Maximum users allowed to log in
maxusers=10
# Message Of The Day (motd)
# It will be displayed after the login procedure.
#motd=/tmp/stupid-ftpd.motd
# Message on quit
# It will be displayed when quitting.
#byemsg=/tmp/stupid-ftpd.bye
# Log
#log=/tmp/stupid-ftpd.log
# User list:
# Format: user=<login> <passwd> <subdir> <maxlogins> <flags>
# <login> user name
# <passwd> password or * for anonymous access
# <subdir> (internally appended to serverroot)
# the user has access to the WHOLE SUBTREE,
# if the server has access to it
# <maxlogins> maximal logins with this usertype
# <flags> D - download
# U - upload + making directories
# O - overwrite existing files
# M - allows multiple logins
# E - allows erase operations
# A - allows EVERYTHING(!)
#
# user ftp is mapped to user anonymous, don't forget this
#
# Examples:
# user=user1 passx /tmp 2 D
# - login: user1, passwd: passx, max login twice (different IPs!)
# only download rights from directory /tmp
# user=user2 passy /home/user2 0 DU
# - login: user2, passwd: passy, no login count limit (different IPs!)
# download+upload rights to directory /home/user2
# user=user3 passz /home/user3 5 DUOM
# - login: user3, passwd: passz, max login count 5 (even from same IP)
# download+upload+overwrite rights to directory /home/user3
# user=user4 passq /tmp 10 -
# - login: user4, passwd: passq, max login count 10 (even from same IP)
# look-only rights at directory /tmp
#
# SEE: ATTENTION remark on the top of this file !!!
user=anonymous * / 5 A
# Banned hosts
# "*" and "?" are allowed here
#ban=192.168.*
#ban=localhost
#ban=*.banme.com
# Ban message (displayed to user who is banned)
# Please don't use more than 70 characters.
#banmsg=Go away !
# Login/password timeout
login-timeout=120
# Timeout (while logged in)
timeout=240
剩下的用默认的配置就可以了,特别注意,设置port参数的时候,2121端口不能使用,无法提供ftp服务。要设置为21端口,经过测试,设置为21端口,在Linux的PC机,报错:21端口被占用。但在嵌入式Linux下,是可以使用的。
stupid-ftpd.Linux6的使用方法:
直接用-f选项指定配置文件:
stupid-ftpd.Linux6 -f stupid-ftpd.conf
然后保证windows与嵌入式Linux系统的IP地址在同一网段,然后再"我的电脑"输入:ftp://192.168.x.x/
这里就不截图了。
分享到:
相关推荐
基于海思hi3531D的嵌入式ftp服务器的搭建,使用stupid-ftpd的工具,具有配置项简单,比vsftpd控制简单、直观,windows是使用FileZilla进行文件的上传和下载。
很小很强大的嵌入式Linux下的FTP服务端软件,支持开源,与大家分享该软件。
stupid-ftpd 源码 arm平台 编译好的可执行程序 配置文件
1、 tar xvzf linux-ftpd-0.17.tar.gz 2、vim configure ( prefix:一般安装到文件系统目录下的/usr/sbin中 with-c-compiler:交叉编译器的选择,嵌入式linux肯定是arm-none-linux-gnueabi-gcc) 3、./configure --...
pure-ftpd服务器是一种免费的、开源的FTP服务器软件,可以在多种操作系统上运行,包括FreeBSD、Linux和Windows。pure-ftpd服务器具有很多优点,例如易于配置、支持虚拟用户和shell用户、支持FXP协议、支持带宽限制、...
linux-ftpd-0.17.tar.gz,ftpd ftp 服务器 Linux 嵌入式
pure-ftpd-1.0.22.tar.gz
pure-ftpd是一款功能强大且灵活的FTP服务器软件,它支持虚拟用户、LDAP、MySQL、PgSQL等多种认证方式。本文档将详细介绍pure-ftpd的安装配置过程,并解释配置文件的相关参数。 一、安装pure-ftpd 在安装pure-ftpd...
pure-ftpd-1.0.20-24.13.i586.rpm
Pure-FTPd是 Ubuntu系统下的一款功能强大且灵活的FTP服务器软件,本文将对其安装和配置进行详细介绍。 安装Pure-FTPd Ubuntu/Debian系统提供了三个不同的Pure-FTPd安装包,即pure-ftpd、pure-ftpd-ldap和pure-ftpd...
ftpd源码可用于文件传输,在arm平台上,只需要交叉编译就可以用
pure-ftpd-1.0.21.tar.gz适用于Linux的初学者
busybox-1.14.2+wu-ftpd-2.6.2实现FTP和Telnet移植详解 平台:Ubuntu8.10 交叉编译器:arm-linux-gcc 3.41 ...ftp移植软件:wu-ftpd-2.6.2 相关软件: bison-1.35. netkit-base-0.17 移植目标:arm2440开发板
pure-ftpd-1.0.42
可以直接移植到arm环境中运行,配置文件修改为自己需要的即可
著名的pure-ftpd服务器源程序 .rar
pure-ftpd最新版源码,国外网站访问太慢,这个小的文件下载都困难,特此分享
pure-ftpd安装步骤,优化配置,用户管理,支持TLS/SSL。
pure-ftpd-1.0.36.tar.gz
wu-ftpd服务器,建议使用旧版本linux安装,需要使用32位lib库。本地使用centos6安装成功。