Chinaunix首页 | 论坛 | 博客
  • 博客访问: 143710
  • 博文数量: 10
  • 博客积分: 1883
  • 博客等级: 上尉
  • 技术积分: 115
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-01 11:26
文章分类
文章存档

2012年(2)

2011年(4)

2010年(3)

2009年(1)

分类: LINUX

2010-08-20 11:46:16

1. tftp 写到内存中测试很方便

执行下面的命令能够看到服务是否已经启动,若已经启动则不用安装,否则需要安装下面的步骤安装tftp-server服务器。
  #netstat -a|grep tftp
  udp 0 0 *:tftp *:*

1.安装 tftp服务器、客户端tftp和守护进程xinetd三个包
    xinetd.i386 2:2.3.14-21.fc10
    tftp-0.49-1.fc10.i386.rpm
    tftp-server-0.49-1.fc10.i386.rpm
2.配置vi /etc/xinetd.d/tftp
修改server_args = -s /tftpboot -c,这里的-c一定要加上,否则只能下载不能上传!!!
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot -c /////////////默认没有-c
disable =no             /////////////////// 默认为yes

per_source = 11
cps = 100 2
flags = IPv4
}

说明:修改项server_args= -s <path> -c,其中<path>处可以改为你的tftp-server的根目录,参数-s指定chroot,-c指定了可

以创建文件。
3. 创建tftp根目录,启动tftp-server
  #mkdir /tftpboot
  #chmod 777 -R /tftpboot
  #service xinetd restart
这样,tftp-server就启动了。你可以登陆本机测试以下,命令如下:
#tftp 127.0.0.
  tftp>get
  tftp>put
  tftp>q
4. 安装过程中出现的问题及原因
现象一:
tftp> get test.log
Transfer timed out.
原因:tftpd服务没有启动

现象二
tftp> put test2
Error code 0: Permission denied

原因:
运行命令,查看系统日志
#tail /var/log/messages
发现有如下一段文字:
Mar 24 19:05:26 localhost setroubleshoot: SELinux is preventing /usr/sbin/in.tftpd (tftpd_t) "write" to tftpboot

(tftpdir_t). For complete SELinux messages. run sealert -l 40a5a6bf-8ded-4bfa-ab6e-fa669a25fc6c
知道这是是由SELinux造成的,在FC3和FC3以后的FC版本中SELinux默认的都是开启的,现关掉它,修改文件 /etc/sysconfig/selinux,
设定其中的
SELINUX=disabled
然后重启电脑即可

或者执行命令 system-config-securitylevel 打开 “安全级别配置”对话框,将SELinux(S)选项中 “强制” 改为“允许”。
或者是 要传的文件真的没有权限, 索性chmod 777 -R /tftp 就o了
现象三:
tftp> put ex070416.log
Error code 1: File not found
原因:
指定的文件不存在;或tftpd启动参数中没有指定-c选项,允许上传文件

现象四:
tftp> get test.log
Error code 2: Only absolute filenames allowed
原因:
在/etc/xinetd.d/tftpd中设置的server_args为/etc/default/tftpd-hpa
cat /etc/default/tftpd-hpa
#Defaults for tftpd-hpa
RUN_DAEMON="no"
OPTIONS="-s /home/tftpd -c -p -U 077 -u tftpd"
设置的时候只要将server_args=改为你自己设定的服务器文件夹就行了


阅读(1355) | 评论(3) | 转发(0) |
给主人留下些什么吧!~~

summersunboy2011-12-16 11:05:13

jczhang168: TX-2440A> ping 192.168.1.64
dm9000 i/o: 0x20000300, id: 0x90000a46
MAC: 1a:2b:3c:4d:5e:6f
ping failed; host 192.168.1.64 is not alive
TX-2440A>.....
ping failed; host 192.168.1.64 is not alive
大哥,ping 不通,你是不是先要检查一下你的网络情况?

jczhang1682011-12-03 23:01:45

TX-2440A> ping 192.168.1.64
dm9000 i/o: 0x20000300, id: 0x90000a46
MAC: 1a:2b:3c:4d:5e:6f
ping failed; host 192.168.1.64 is not alive
TX-2440A> tftp 3000C000 LED.bin
dm9000 i/o: 0x20000300, id: 0x90000a46
MAC: 1a:2b:3c:4d:5e:6f
TFTP from server 192.168.1.64; our IP address is 192.168.1.100
Filename 'LED.bin'.
Load address: 0x3000c000
Loading: T T T T T T T T T T
Retry count exceeded; starting again
TFTP

jczhang1682011-12-03 22:59:05

请教下:
我在虚拟机上执行tftp 127.0.0.1
上时,可以get文件到另外一个目录中,但是下载文件到开发版就是有问题,不知道是为什么?ip在同一个网段。无法ping通。
Loading: T T T T T T transmission timeout
T T T T
Retry count exceeded; starting again
TFTP from server 192.168.1.64; our IP address is 192.168.1.100
Filename '/tftpboot/LED.bin'.
小弟是学arm的新手,请帮帮忙,谢谢!