busybox内置tftpd服务器配置

server服务器配置
方法1:
# mkdir /gliethttp_tftpd_dir
# cp /bin/busybox /gliethttp_tftpd_dir
# udpsvd -vE 0 69 tftpd -c /gliethttp_tftpd_dir &
// 上面的0表示对所有ip地址都进行侦听
// 如果设置为127.0.0.1那么只能开发板本地arm可以进行ftp
// 比如开发板eth0的的ip地址设为192.168.1.102,那么就不能通过该ip登录
// 所以上面指定ip等于0,那么无论来自127.0.0.1还是192.168.1.102网络地址的
// 数据都能使用tftpd服务器.
// 参数-c表示允许client客户端上传文件到/gliethttp_tftpd_dir根目录[luther.gliethttp]
方法2:
# mkdir /gliethttp_tftpd_dir
# cp /bin/busybox /gliethttp_tftpd_dir
# vi /etc/inetd.conf
69 dgram udp nowait root tftpd tftpd -c /gliethttp_tftpd_dir
# inetd                 // inetd会执行/etc/inetd.conf脚本中的命令行,这样ftpd就作为daemon运行到起来了
(注意:以上2种方式运行的tftpd都不会在ps中看到tftpd进程的运行)


在pc上执行如下测试  (注意:必须使用i386版本busybox的tftp程序才可以进行数据传输,
ubuntu 8.10上默认的tftp因为封包协议问题不能工作,将提示:Error code 0: malformed packet)

1.将pc上的gliethttp.c文件put到arm开发板tftpd的根目录下,并且重命名为gliethttp.pc.c
luther@gliethttp:~$ busybox tftp -l gliethttp.c -r gliethttp.pc.c -p 192.168.1.102
2.将arm开发板tftpd根目录下的busybox拷贝到pc上,重命名为busybox.arm
luther@gliethttp:~$ busybox tftp -l busybox.arm -r busybox -p 192.168.1.102
luther@gliethttp:~$ ll busybox.arm 
-rw-r--r-- 1 ubuntu ubuntu 808K 2009-08-21 12:41 busybox.arm


# tftp
BusyBox v1.14.3 (2009-08-10 10:13:59 UTC) multi-call binary

Usage: tftp [OPTION]... HOST [PORT]

Transfer a file from/to tftp server

Options:
        -l FILE Local FILE
        -r FILE Remote FILE
        -g      Get file
        -p      Put file
        -b SIZE Transfer blocks of SIZE octets
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值