|
1.tftp概论
TFTP(Trivial File Transfer Protocol,简单文件传输协议)是TCP/IP协议族中的一个用来在客户机与服务器之间进行简单文件传输的协议,提供不复杂、开销不大的文件传输服务。端口号为69。
TFTP是一个传输文件的简单协议,它基于UDP协议而实现。此协议设计的时候是进行小文件传输的。因此它不具备通常的FTP的许多功能,它只能从文件服务器上获得或写入文件,不能列出目录,不进行认证,它传输8位数据。可以分为8位文本(ASCII)和8位二进制两种mode。
2、tftp
安装linux下的tftp服务是由xinetd(还有openbsd-inetd等其他服务)所设定的,默认情况下tftp是处于关闭状态。所以要修改tftp的配置文件,开启tftp服务。
sudo apt-cache search xinet
sudo apt install xinet
sudo apt install tftp-server
sudo apt install tftp
注意,xinet的配置文件在/etc/xinetd.d目录下,在该目录下建立如下文件:
cd /etc/xinetd.d
sudo touch tftp
sudo vim tftp
#/etc/xinetd.d/tftp配置文件的开头:
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/tftpboot/ -c # -s 指得tftp的根目录,-c 指得可以创建文件
disable = no # 为no表示tftp服务器开启,yes表示tftp服务器关闭,即停止服务。
per_source = 11
cps = 100 2
flags = IPv4
}
配置好了就可以启动xinetd了, systemctl restart xinetd
查看状态: systemctl status xinetd
3、tftp的使用
tftp 的使用可以参考 man tftp
一般用法: tftp 10.10.5.200
tftp>verbos # 显示废话
tftp>trace # 追踪过程
tftp>binary # 使用二进制模式传输
tftp>get 10.10.5.200:some_file_to_get.img
tftp>q
一般可以用于在远程下载映像文件,调试系统适用。
在安装后,最好在本地试一下: tftp -g -l 127.0.0.1 # 本地下载一个文件,-g test.img,要看tftp的版本,像有些版本低的就不支持这个命令。
Reference: https://blog.csdn.net/xiongzhizhu/article/details/52052335
|
-
-
tftp
226 Bytes, 下载次数: 129
|