Ubuntu 10.04 tftp服务器架设

1.安装
sudo apt-get install tftpd-hpa tftp-hpa

2.配置
sudo gedit /etc/default/tftpd-hpa

# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/opt/tftpboot" //填入你的tftp服务目录
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="-l -c -s"


选项参考
OPTIONS
-l

Run the server in standalone (listen) mode, rather than run from inetd. In listen mode, the -t option is ignored, and the -a option can be used to specify a specific local address or port  to listen to.
       
-a [address][:port]
Specify a specific address and port to listen to when called with the -l option. The default is to listen to the tftp port specified in /etc/services on all local addresses.listen 的 ip address 和 Port

-c

Allow new files to be created. By default, tftpd will only allow upload of files that already exist. Files are created with default permissions allowing anyone to read or write them, unless the -p or -U options are specified.
           
-s

(决定tftp根目录)Change root directory on startup. This means the remote host does not need to pass along the directory as part of the transfer, and may add security. When -s is specified, exactly one directory should be specified on the command line. The use of this option is recommended for security as well as compatibility with some boot ROMs which cannot be easily made to include a directory name in its request.


重启OK
注意:10.04以下的版本用下面的配置
 RUN_DAEMON="yes"
 OPTIONS="-l -c -s /tftpboot"  


3.启动服务
sudo service tftpd-hpa restart


4.测试
cd /opt/tftpboot
touch tftp_down.txt

echo i am an tftp download test doc! > tftp_down.txt


cd ~/
tftp localhost
get test.txt

同理!put一个tftp_up文件上去测试.

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值