tftpd-hpa是一个功能增强的TFTP服务器。它提供了很多TFTP的增强功能,它已经被移植到大多数的现代UNIX系统。
-
安装
chenjian@chenjian-pc:~$ sudo apt-get install tftpd-hpa tftp-hpa
-
配置
tftp-hpa的配置文件为/etc/default/tftpd-hpa
chenjian@chenjian-pc:~$
# 编辑/etc/default/tftpd-hpa如下
-----------------------------------------------------------------------------------
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot" //这里是你的tftpd-hpa的服务目录
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="-l -c -s"
注:如果是在10.04以下的版本用下面的配置
tftp-hpa的配置文件为/etc/default/tftpd-hpa
RUN_DAEMON="yes"
OPTIONS="-l -c -s /tftpboot"
-----------------------------------------------------------------------------------------------------------
3.启动服务
chenjian@chenjian-pc:~$
//查看启动状态
chenjian@chenjian-pc:~$
4.修改tftp目录的权限
//一定要设定,-R是递归把文件下所有文件都改掉
chenjian@chenjian-pc:~$
5.测试
chenjian@chenjian-pc:~$
chenjian@chenjian-pc:~$
随便输入一些东西.
chenjian@chenjian-pc:~$
chenjian@chenjian-pc:~$
//tftp命令
tftp>get test.txt
查看当前目录是否有test.txt这个文件。
同理,在当前目录下准备一个文件test1.txt
//tftp命令
tftp>put test1.txt
查看/tftpboot目录是否有test1.txt这个文件。
tftp退出:
//tftp命令
tftp>quit(q)
注:tftp localhost改成tftp 127.0.0.1或者tftp <你的IP地址>也可以。