Tftpd-hpa

安装

使用下面的命令来安置 tftpd-hpa 服务器:

 $ sudo apt-get install tftpd-hpa

注:若server未安装xinetd则在ubuntu9.04中会自动下载openbsd-inetd并安装,使用tftp过程中出错很多时候是因xinetd版本问题;

[编辑] 配置

tftp-hpa 的配置文件为 /etc/default/tftpd-hpa

 RUN_DAEMON="yes" 
 OPTIONS="-l -c -s /tftpboot"    
  1. -c为可创建新文件,若无此参数,put命令则可能出现错误提示,此时只能覆盖原有文件不能创建新文件(I can't create a new file even i  specified the "-c" option);

无论何种方式配置tftp-server -c参数决定是否能正常写入数据;这里指定 tftpd 使用的目录为 /tftpboot,注意要修改目录属性:chmod 777 tftpboot

[编辑] 启动和停止

[编辑] 启动

 # /etc/init.d/tftpd-hpa start

[编辑] 停止

 # /etc/init.d/tftpd-hpa stop

[编辑] 参考

====

http://wiki.ubuntu.org.cn/Tftpd-hpa


------------------------------------------------------- 

Installation

A TFTP server is mainly required for booting operating systems orconfigurations over the network. The installation is done by:

# apt-get install tftpd-hpa

Server Configuration

The TFTP server can be started by one of two ways:

  1. directly as daemon, or
  2. via inetd.

In the first case, running as daemon, the linestarting with tftp in /etc/inetd.conf has to becommented (described here for openbsd-inetd or compatible):

Excerpt: /etc/inetd.conf
#tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot

and it has to be enabled in the init script's configuration:

Excerpt: /etc/default/tftpd-hpa
RUN_DAEMON="yes"

In the second case, running via inetd, the linestarting with tftp in /etc/inetd.conf has to beuncommented (for Debian's default inet daemon openbsd-inetd):

Excerpt: /etc/inetd.conf
tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot

and it has to be disabled in the init script's configuration:

Excerpt: /etc/default/tftpd-hpa
RUN_DAEMON="no"

The root directory from where files can be downloaded by a client defaultsto /var/lib/tftpboot. It can be changed to, e.g., to/new/tftp/root, if required:

Excerpt: /etc/default/tftpd-hpa
OPTIONS="-l -s /new/tftp/root"

Files can be put into this directory and downloaded from a client withoutpassing this root directory in its requests.

Finally, restart openbsd-inetd and tftpd-hpa:

# /etc/init.d/openbsd-inetd restart
# /etc/init.d/tftpd-hpa restart

Server Testing

Put a file foo into the rootdirectory of the TFTP server. Install a TFTP client:

# apt-get install tftp

and download the file (not neccessarily as root):

$ tftp server.example.com
tftp> get foo
tftp> q

The file should now exist into your current working directory.

Networking Requirements

Prerequisite: Shorewall In case of a packetfilter (Shorewall), you will have to permit access from the clients. Thedifficulties resulting from changing source/destination ports in TFTP areautomatically handled by the netfilter NAT/Conntrack helper modules that areloaded by Shorewall by default.

Excerpt: /etc/shorewall/rules
# TFTP
#
ACCEPT		net		$FW		udp	69
#

and restart the packet filter:

# shorewall restart

====

http://chschneider.eu/linux/server/tftpd-hpa.shtml


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值