Ubuntu下搭建tftp服务器最简单方法

ubuntu12.4下tftp设置
ubuntu12.4下tftp设置精华
 
因调试6410开发板,需在ubuntu12.04下搭建tftp服务器,在网搜了多个ubuntu下配置tftp的文件,发现都有或多或少的问题,如下是我的配置过程,已验证通过可供参考!!!
1)安装tftp-hpa,tftpd-hpa, xinetd
~$ sudo apt-get install tftp-hpa , tftpd-hpa, xinetd
2) 在/etc/xinetd.d/下创建并配置tftp文件
~$ sudo vim /etc/xinetd.d/tftp
  1 service tftp
  2 {
  3     socket_type = dgram
  4     protocol = udp
  5     wait = yes
  6     user = root
  7     server = /usr/sbin/in.tftpd
  8     server_args = -s/tftpboot -c
  9     disable = no
 10    per_source = 11
 11    cps =100 2
 12    flags = IPv4
 13 }
-c 用于开启上传功能。
3)配置tftpd-hpa
~$ sudo vim /etc/default/tftpd-hpa 
 
  1 #/etc/default/tftpd-hpa
  2 
  3 TFTP_USERNAME="tftp"
  4 TFTP_DIRECTORY="/tftpboot"
  5 TFTP_ADDRESS="0.0.0.0:69"
  6 TFTP_OPTIONS="-l -c -s"
其中/tftpboot为 tftp共享目录
4) 修改xinetd.conf文件
 
~$ sudo vim /etc/xinetd.conf 
 
defaults
  6 {
  7 
  8 # Please note that you need a log_type line to be able to use log_on_success
  9 # and log_on_failure. The default is the following :
 10 # log_type = SYSLOG daemon info
 11 
 12 }
 13 
 14 #includedir /etc/xinetd.d
 15 tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot
5) 重启tftp服务并测试
     sudo service tftpd-hpa restart
     sudo /etc/init.d/xinetd reload
     sudo /etc/init.d/xinetd restart
6)本机测试
     在/tftpboot下创建测试文件love
     #cd /tftpboot
     #echo  xuguodongaigongxia > love
     #chmod 777 love
测试一下 tftp服务:
     重新打开一个终端
     #tftp 127.0.0.1
     tftp>get love
     tftp>q      
     #ls
    退出后,查看当前目录,发现love文件已在当前目录。
    如果上述设置还不行的话,那么就要把selinux禁用掉:
    sudo gedit /etc/selinux/config      //如果没有selinux/config这个文件,则创建。
# This file controls the state of SE Linux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=enforcing
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted
把上面的SELINUX=enforcing 改为:SELINUX=disable  禁用SeLinux
然后reboot重启P
C

1,两个host(A host is any computer connected to a network)之间通过tftp protocol通信,必须有一个host上装有tftp server(两个host都有也行),而且另一方装有tftp client。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值