ubuntu tftp【转】
本文转载自: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【转】的更多相关文章
- 配置ubuntu - tftp server服务器步骤
配置Ubuntu tftp服务的步骤: 1.安装相关软件包:Ubuntu tftp(服务端),tftp(客户端),xinetd sudo apt-get install tftpd tftp xine ...
- Ubuntu TFTP 服务
/******************************************************************** * Ubuntu TFTP 服务 * 说明: * 在Ubun ...
- ubuntu tftp 配置
1:sudo apt-get install tftp tftpd openbsd-inetd特别指出很多文章里用的是netkit-inetd,但是实际下载时发现这个软件是下不到的,特改用openbs ...
- ubuntu tftp server config
1.安装tftp-server sudo apt-get install tftpd-hpa sudo apt-get install tftp-hpa(如果不需要客户端可以不安装) tftp-hpa ...
- Ubuntu 12.04 搭建TFTP服务器
吐槽先:在Ubuntu上搭建TFTP服务器,网上搜到一堆资料,可惜基本都是部分能用,至于哪些部分能用还要自己摸索着试出来,郁闷之情仅次于找不到任何资料…… ---------------------- ...
- MPSOC之9——host、embeded间tftp、nfs、ftp环境搭建
tftp 可传输单个文件,不能传文件夹 需要通过命令传输文件,略显复杂 ==一般调试kernel时,用uboot通过tftp方式启动,不用每次都烧写存储介质== nfs 在host linux(ubu ...
- 嵌入式Linux系统开发环境搭建
Linux kernel Complier: http://supportopensource.iteye.com/blog/680483 sudo make mrproper 净化解 ...
- 嵌入式系统LINUX环境搭建
Linux kernel Complier: http://supportopensource.iteye.com/blog/680483 sudo make mrproper 净化解 ...
- ubuntu 14.04LTS 环境下搭建tftp服务器
花费我一整天的时间在 ubuntu 14.04LTS 环境下搭建tftp服务器,网上好多资料参差不齐,简单来说,TFTP(Trivial File Transfer Protocol),是一个基于UD ...
随机推荐
- hdu 1792 A New Change Problem(互质数之间最大不能组合数和不能组合数的个数)
题意:求互质的m和n的最大不能组合数和不能组合数的个数 思路:m和n的最大不能组合数为m*n-m-n,不能组合数的个数为(m-1)*(n-1)/2 推导: 先讨论最大不能组合数 因为gcd(m,n)= ...
- php代码中注释的含义
最近在梳理和优化手上的项目代码,这个项目已经走过好几任了,每一任的开发人员多多少少都有一些差异和各自的习惯,所以代码逻辑和写法上都有点[乱]. 在代码中,注释是一个非常重要的信息,更何况是接手其他人的 ...
- [Python3网络爬虫开发实战] 1.9.4-Scrapyd API的安装
安装好了Scrapyd之后,我们可以直接请求它提供的API来获取当前主机的Scrapy任务运行状况.比如,某台主机的IP为192.168.1.1,则可以直接运行如下命令获取当前主机的所有Scrapy项 ...
- php 实现301重定向跳转实例代码
本文主要介绍php 实现301重定向跳转,通过实例代码让大家更好的理解重定向的方法,有需要的小伙伴可以参考下 在php中301重定向实现方法很简单我们只要简单的利用header发送301状态代码,然后 ...
- python while、continue、break
while循环实现用户登录 _user = "tom" _passwd = "abc123" counter = 0 while counter < 3: ...
- Leetcode 220.存在重复元素III
存在重复元素III 给定一个整数数组,判断数组中是否有两个不同的索引 i 和 j,使得 nums [i] 和 nums [j] 的差的绝对值最大为 t,并且 i 和 j 之间的差的绝对值最大为 ķ. ...
- wangEditor
wangEditor 基于javascript和css开发的 Web富文本编辑器, 轻量.简洁.易用.开源免费 http://www.wangeditor.com/index.html API htt ...
- spring-session(一)揭秘
前言 在开始spring-session揭秘之前,先做下热脑(活动活动脑子)运动.主要从以下三个方面进行热脑: 为什么要spring-session 比较traditional-session方案和s ...
- 【BZOJ2818】Gcd(莫比乌斯反演,欧拉函数)
题意:给定整数N,求1<=x,y<=N且Gcd(x,y)为素数的数对(x,y)有多少对 1<=N<=10^7 思路:莫比乌斯反演,同BZOJ2820…… ; ..max]of ...
- c++ stl 使用汇总(string,vector,map,set)
1.string 1>substr(),截取字串的方法.返回一个从指定位置开始,并具有指定长度的子字符串.参数 start(必选),所需的子字符串的起始位置.字符串中第一个字符的索引为 0.le ...