本文转载自:http://www.cnblogs.com/wxl309729255/articles/2816594.html

配置eth0的 IP地址, 同时激活该设备。

#ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up

1. Install tftpd and related packages.

$ sudo apt-get install xinetd tftpd tftp

2. Create /etc/xinetd.d/tftp and put this entry:

service tftp
{
disable =no
socket_type =dgram
protocol =udp
wait =yes
user =root
server =/usr/sbin/in.tftpd
server_args =-s /tftpboot
per_source = 11
cps = 1002
flags = IPv4
}

3. Make /tftpboot directory

$ sudo mkdir /tftpboot
$ sudo chmod 777 /tftpboot

把/etc/init.d/atfpd
文件中的if["$USE_INETD"="true"]中的true改为false

4. Start tftpd through xinetd

$ sudo /etc/init.d/xinetd restart

5. Testing. Tranfering file hda.txt from 192.168.1.100 (Client using tftp) to 192.168.1.100 (Server 192.168.1.100). Get an example file to transfer (eg. hda.txt)

$ touch /tftpboot/hda.txt

$ chmod 777 /tftpboot/hda.txt

$ ls -l /tftpboot/
total 0

-rwxrwxrwx 1 davids davids 0 2006-03-27 23:04 hda.txt

$ tftp 192.168.1.100

tftp> put hda.txt
Sent 722 bytes in 0.0 seconds
tftp> quit
$ ls -l /tftpboot/
total 4
-rwxrwxrwx 1 davids davids 707 2006-03-27 23:07 hda.txt

http://hi.baidu.com/wwwkljoel/blog/item/af42f612ade9905bf919b856.html

[注意事项]

如果从tftp服务器下载失败,

要确保服务器的根目录有可执行的权限。

$ chmod -R 777 tftp

使用中发现能正常下载文件,

$ tftp 192.168.1.222
tftp> get zImage
Received 1692890 bytes in 0.2 seconds

可是上传文件不成功,

提示错误:

tftp> put dic.txt
Error code 2: Access violation

求助于google, 得下面一段说明,问题解决。

The tftp man page says:

Because there is no user-login or validation within the TFTP
protocol, the remote site will probably have some sort of
file-access restrictions in place. The exact methods are
specific to each site and therefore dif ficult to document here.

So apparently the site you're trying to get the file from has some
kind of access restrictions in place. Take a look at the tftpd man
page on the remote host. The linux tftpd manual says, in part, "Due to
the lack of authentication information, tftpd will allow only publicly
readable files to be accessed. Files may be written only if they
already exist and are publicly writable."

上面主要意思就是: tftp服务器缺少必要的身份验证,

所以默认只允许下载文件,要上传文件,必须是服务器中已存在同名的文件,

且该文件权限允许被覆盖。

所以首先在服务中创建一个与要上传的文件同名的文件,并更改权限。

$ touch dic.txt

$ chmod 777 dic.txt

重新上传,成功。
tftp> put dic.txt
Sent 13770 bytes in 0.0 seconds

ubuntu tftp【转】的更多相关文章

  1. 配置ubuntu - tftp server服务器步骤

    配置Ubuntu tftp服务的步骤: 1.安装相关软件包:Ubuntu tftp(服务端),tftp(客户端),xinetd sudo apt-get install tftpd tftp xine ...

  2. Ubuntu TFTP 服务

    /******************************************************************** * Ubuntu TFTP 服务 * 说明: * 在Ubun ...

  3. ubuntu tftp 配置

    1:sudo apt-get install tftp tftpd openbsd-inetd特别指出很多文章里用的是netkit-inetd,但是实际下载时发现这个软件是下不到的,特改用openbs ...

  4. ubuntu tftp server config

    1.安装tftp-server sudo apt-get install tftpd-hpa sudo apt-get install tftp-hpa(如果不需要客户端可以不安装) tftp-hpa ...

  5. Ubuntu 12.04 搭建TFTP服务器

    吐槽先:在Ubuntu上搭建TFTP服务器,网上搜到一堆资料,可惜基本都是部分能用,至于哪些部分能用还要自己摸索着试出来,郁闷之情仅次于找不到任何资料…… ---------------------- ...

  6. MPSOC之9——host、embeded间tftp、nfs、ftp环境搭建

    tftp 可传输单个文件,不能传文件夹 需要通过命令传输文件,略显复杂 ==一般调试kernel时,用uboot通过tftp方式启动,不用每次都烧写存储介质== nfs 在host linux(ubu ...

  7. 嵌入式Linux系统开发环境搭建

    Linux kernel Complier: http://supportopensource.iteye.com/blog/680483 sudo make mrproper         净化解 ...

  8. 嵌入式系统LINUX环境搭建

    Linux kernel Complier: http://supportopensource.iteye.com/blog/680483 sudo make mrproper         净化解 ...

  9. ubuntu 14.04LTS 环境下搭建tftp服务器

    花费我一整天的时间在 ubuntu 14.04LTS 环境下搭建tftp服务器,网上好多资料参差不齐,简单来说,TFTP(Trivial File Transfer Protocol),是一个基于UD ...

随机推荐

  1. 「 Luogu P1379 」 八数码难题

    # 解题思路 这题不难,主要就是考虑如何判重,如果直接在 $9$ 个位置上都比较一遍的话.你会得到下面的好成绩 所以考虑另一种方法: 将九个位置压成一个整数,并且因为只有九个数,所以不会超出 $int ...

  2. [Luogu] P3846 [TJOI2007]可爱的质数

    题目描述 给定一个质数P(2<=P<2312^{31}231),以及一个整数B(2<=B<P),一个整数N(2<=N<P). 现在要求你计算一个最小的L,满足BL≡ ...

  3. 转:Centos7安装zabbix3.4超详细步骤解析

    安装前准备: 1.1 安装依赖包: yum -y install wget net-snmp-devel OpenIPMI-devel httpd openssl-devel java lrzsz f ...

  4. 树莓派 -- 输入设备驱动 (key) 续1

    测试 安装 input-utils pi@raspberrypi:~ $ sudo apt-get install input-utils Reading package lists... Done ...

  5. C语言的移位操作符及位运算

    C语言的移位操作符 位移位运算符是将数据看成二进制数,对其进行向左或向右移动若干位的运算.位移位运算符分为左移和右移两种,均为双目运算符.第一运算对象是移位对象,第二个运算对象是所移的二进制位数. 位 ...

  6. Directory获取方式

    1) FSDirectory.open FSDirectory.open()会以最合适的方式来获取一个Directory对象. 2) RAMDirectory 可以将磁盘中的索引加载到内存中,访问速度 ...

  7. 创建Javaweb项目及MyEclipse视图的配置

    在myEclipse里--右键new--Web Project 视图的配置--Window--Show View-Other在里面输入要找的视图例如(servers)或者直接 Window--rese ...

  8. DFS template and summary

    最近一直在学习Deep Frist Search,也在leetcode上练习了不少题目.从最开始的懵懂,到现在遇到问题基本有了思路.依然清晰的记得今年2月份刚开始刷题的时做subsets的那个吃力劲, ...

  9. HDU 5643 King's Game 【约瑟夫环】

    题意: 变形的约瑟夫环,最初为每个人编号1到n,第i次删去报号为i的人,然后从它的下一个人开始重新从1开始报号,问最终剩下第几号人? 分析: 首先看一下裸的约瑟夫环问题: 共n个人,从1开始报数,报到 ...

  10. Evaluate Reverse Polish Notation(逆波兰式)

    Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, ...