tftpd-hpa使用完全教程
2017-12-13 15:16
417 查看
0,源代码下载地址:https://www.kernel.org/pub/software/network/tftp/
1,安装,
2,tftp-hpa 的配置文件为 /etc/default/tftpd-hpa
#Defaults for tftpd-hpa
RUN_DAEMON="no"
OPTIONS="-s /home/ch/tftpboot -c -p -U 077 -u tftpd"
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/home/ch/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
3,使用选项,-s选项,secure选项,后面要跟一个目录,否则会报错。
Dec 13 14:14:42 ch-Founder-PC in.tftpd[12796]: no -s directory
-c选项,是可以写文件。但是-c选项必须要在-s选项存在的情况下才能发挥作用。
-l选项,可以自己启动,不依赖与xinetd,或者/etc/init.d/tftpd-hpa脚本。
-v选项会在/var/log/syslog里面写入日志,-vv会写入更详细的信息。
root@ch-Founder-PC:~# /usr/sbin/in.tftpd -l -vv -s /home/ch/tftpboot
root@ch-Founder-PC:~# tftp 172.22.24.150
tftp> put openbsdinetd
Error code 1: File not found
tftp> put strlcpy.c
Error code 1: File not found 这里是没有使用-c选项
tftp> put strlcpy.c
Sent 480 bytes in 0.0 seconds 这里是使用了-c选项
tftp> put strlcpy.c
Error code 2: Only absolute filenames allowed 这里没有使用-s选项
tftp> put /root/strlcpy.c
Error code 0: Permission denied 这里使用了-c选项,但是没有使用-s选项
tftp> put strlcpy.c
Sent 480 bytes in 0.0 seconds 这里使用了-s选项和-c选项
tftp>
root@ch-Founder-PC:~# /usr/sbin/in.tftpd -l -vv -s /home/ch/tftpboot -c
root@ch-Founder-PC:~# /usr/sbin/in.tftpd -l -vv -c
root@ch-Founder-PC:~# /usr/sbin/in.tftpd -l -vv -s /home/ch/tftpboot -c
Dec 13 14:35:53 ch-Founder-PC in.tftpd[12944]: WRQ from 172.22.24.150 filename openbsdinetd
Dec 13 14:35:53 ch-Founder-PC in.tftpd[12944]: sending NAK (1, File not found) to 172.22.24.150
Dec 13 14:36:24 ch-Founder-PC in.tftpd[12945]: WRQ from 172.22.24.150 filename strlcpy.c
Dec 13 14:36:24 ch-Founder-PC in.tftpd[12945]: sending NAK (1, File not found) to 172.22.24.150
Dec 13 14:38:59 ch-Founder-PC in.tftpd[12965]: WRQ from 172.22.24.150 filename strlcpy.c
Dec 13 14:40:58 ch-Founder-PC in.tftpd[12977]: WRQ from 172.22.24.150 filename strlcpy.c
Dec 13 14:40:58 ch-Founder-PC in.tftpd[12977]: sending NAK (2, Only absolute filenames allowed) to 172.22.24.150
Dec 13 14:42:17 ch-Founder-PC in.tftpd[12982]: WRQ from 172.22.24.150 filename /root/strlcpy.c
Dec 13 14:42:17 ch-Founder-PC in.tftpd[12982]: sending NAK (0, Permission denied) to 172.22.24.150
Dec 13 14:43:39 ch-Founder-PC in.tftpd[12995]: WRQ from 172.22.24.150 filename /root/strlcpy.c
Dec 13 14:43:39 ch-Founder-PC in.tftpd[12995]: sending NAK (0, Permission denied) to 172.22.24.150
Dec 13 14:50:13 ch-Founder-PC in.tftpd[13032]: WRQ from 172.22.24.150 filename strlcpy.c
length = strlen(msg) + 1;
memcpy(tp->th_msg, msg, length);
length += 4; /* Add space for header */
1,安装,
sudo apt-get install tftpd-hpa
2,tftp-hpa 的配置文件为 /etc/default/tftpd-hpa
#Defaults for tftpd-hpa
RUN_DAEMON="no"
OPTIONS="-s /home/ch/tftpboot -c -p -U 077 -u tftpd"
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/home/ch/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
3,使用选项,-s选项,secure选项,后面要跟一个目录,否则会报错。
Dec 13 14:14:42 ch-Founder-PC in.tftpd[12796]: no -s directory
-c选项,是可以写文件。但是-c选项必须要在-s选项存在的情况下才能发挥作用。
-l选项,可以自己启动,不依赖与xinetd,或者/etc/init.d/tftpd-hpa脚本。
-v选项会在/var/log/syslog里面写入日志,-vv会写入更详细的信息。
root@ch-Founder-PC:~# /usr/sbin/in.tftpd -l -vv -s /home/ch/tftpboot
root@ch-Founder-PC:~# tftp 172.22.24.150
tftp> put openbsdinetd
Error code 1: File not found
tftp> put strlcpy.c
Error code 1: File not found 这里是没有使用-c选项
tftp> put strlcpy.c
Sent 480 bytes in 0.0 seconds 这里是使用了-c选项
tftp> put strlcpy.c
Error code 2: Only absolute filenames allowed 这里没有使用-s选项
tftp> put /root/strlcpy.c
Error code 0: Permission denied 这里使用了-c选项,但是没有使用-s选项
tftp> put strlcpy.c
Sent 480 bytes in 0.0 seconds 这里使用了-s选项和-c选项
tftp>
root@ch-Founder-PC:~# /usr/sbin/in.tftpd -l -vv -s /home/ch/tftpboot -c
root@ch-Founder-PC:~# /usr/sbin/in.tftpd -l -vv -c
root@ch-Founder-PC:~# /usr/sbin/in.tftpd -l -vv -s /home/ch/tftpboot -c
Dec 13 14:35:53 ch-Founder-PC in.tftpd[12944]: WRQ from 172.22.24.150 filename openbsdinetd
Dec 13 14:35:53 ch-Founder-PC in.tftpd[12944]: sending NAK (1, File not found) to 172.22.24.150
Dec 13 14:36:24 ch-Founder-PC in.tftpd[12945]: WRQ from 172.22.24.150 filename strlcpy.c
Dec 13 14:36:24 ch-Founder-PC in.tftpd[12945]: sending NAK (1, File not found) to 172.22.24.150
Dec 13 14:38:59 ch-Founder-PC in.tftpd[12965]: WRQ from 172.22.24.150 filename strlcpy.c
Dec 13 14:40:58 ch-Founder-PC in.tftpd[12977]: WRQ from 172.22.24.150 filename strlcpy.c
Dec 13 14:40:58 ch-Founder-PC in.tftpd[12977]: sending NAK (2, Only absolute filenames allowed) to 172.22.24.150
Dec 13 14:42:17 ch-Founder-PC in.tftpd[12982]: WRQ from 172.22.24.150 filename /root/strlcpy.c
Dec 13 14:42:17 ch-Founder-PC in.tftpd[12982]: sending NAK (0, Permission denied) to 172.22.24.150
Dec 13 14:43:39 ch-Founder-PC in.tftpd[12995]: WRQ from 172.22.24.150 filename /root/strlcpy.c
Dec 13 14:43:39 ch-Founder-PC in.tftpd[12995]: sending NAK (0, Permission denied) to 172.22.24.150
Dec 13 14:50:13 ch-Founder-PC in.tftpd[13032]: WRQ from 172.22.24.150 filename strlcpy.c
length = strlen(msg) + 1;
memcpy(tp->th_msg, msg, length);
length += 4; /* Add space for header */
相关文章推荐
- SQL Compare 10.4.8.87 Edition 数据库比较工具 完全破解+使用教程
- SQL Server 开发利器 SQL Prompt 6.5 T-SQL智能感知分析器 下载地址 完全破解+使用教程
- SQL开发利器SQL Prompt 5.1完全破解+使用教程
- SQL Compare数据库比较工具 完全破解+使用教程
- 转 SQL开发利器SQL Prompt 5.1完全破解+使用教程
- 使用SpriteBuilder制作Cocos2D游戏完全中文教程(三)
- OkHttp使用完全教程
- Red Gate系列之一 SQL Compare 10.4.8.87 Edition 数据库比较工具 完全破解+使用教程
- Android 2.0正式版SDK下载模拟器安装使用完全教程(最全版)
- 使用教程:Virtual PC安装使用完全指南
- Red Gate系列之一 SQL Compare 10.4.8.87 Edition 数据库比较工具 完全破解+使用教程
- OkHttp使用完全教程
- 最详细的Cydia使用教程------完全版。新补充Cydia1.1.1离线安装(升级)方法。
- 使用SpriteBuilder制作Cocos2D游戏完全中文教程(九)
- Red Gate系列之八 SQL Connect 1.1.1.19 Edition 数据库连接及操作工具 完全破解+使用教程
- Red Gate系列之三 SQL Server 开发利器 SQL Prompt 5.3.4.1 Edition T-SQL智能感知分析器 完全破解+使用教程
- Linux--软件安装+常用命令--1:Ubuntu Server 12.04 安装手记 + Ubuntu 12.04 菜鸟完全使用教程PDF
- Git时代的VIM不完全使用教程
- Red Gate系列之五 .NET Reflector 7.6.1.824 Edition .NET程序反编译神器(附插件安装教程2012-10-13更新) 完全破解+使用教程
- SQL开发利器SQL Prompt 5.1完全破解+使用教程