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 ...
随机推荐
- find -print0和xargs -0原理及用法
平常我们经常把find和xargs搭配使用,例如: find . -name "*.txt" | xargs rm 但是这个命令如果遇到文件名里有空格或者换行符,就会出错.因为xa ...
- ruby on rails 常见配置错误解决
error:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError) 先删除 Ruby下的D:\Ruby22- ...
- 杭电 5363 求集合的非空子集中key的数量
Description soda has a set S with n integers {1,2,…,n}. A set is called key set if the sum of intege ...
- ACdream 1063 字典树
ACdream 1063 字典树 平衡树 神奇的cxlove有一颗平衡树,其树之神奇无法用语言来描述 OrzOrz. 这棵树支持3种操作: 1.加入一个数到树中,维护平衡树的合法性: 2.给一个数X, ...
- Blend 混合
Shader 中的混合 Blend Off :不混合 Blend SrcFactor DstFactor :SrcFactor 是源系数,DstFactor是目标系数,源系数是由片段着色器计算出来 ...
- HttpModule用户的验证
HttpModule是向实现类提供模块初始化和处置事件.当一个HTTP请求到达HttpModule时,整个ASP.NET Framework系统还并没有对这个HTTP请求做任何处理,也就是说此时对于H ...
- hihoCoder#1114 小Hi小Ho的惊天大作战:扫雷·一
原题地址 回溯+搜索 枚举每个位置上能否放地雷,当第i个位置枚举完成后,第i-1个位置的情况就确定了,此时,检查第i-1个位置是否满足要求,即左右间隔为1的范围内地雷数是否等于申明数字,如果满足条件, ...
- redis持久化机制【十三】
一.Redis提供了哪些持久化机制: redis的高性能是因为其所有数据都存在了内存中 ,为了使redis在重启之后数据仍然不丢失,需要将数据同步到硬盘中,这一过程就是持久化. redis支持两种方式 ...
- SQL SERVER代理作业删除失败问题
在SQL Server 2005上遇到了先删除已运行维护计划后,再删除代理中由其产生的作业时,提示删除失败. DELETE 语句与 REFERENCE 约束"FK_subplan_job ...
- CSS实现自适应不同大小屏幕的背景大图的两种方法(转自简书)
CSS实现自适应不同大小屏幕的背景大图的两种方法 一张清晰漂亮的背景图片能给网页加分不少,设计师也经常会给页面的背景使用大图,我们既不想图片因为不同分辨率图片变形,也不希望当在大屏的情况下,背景有一块 ...