不同操作系统下的tftp指令
tftp指令
windows 操作系统可以使用自带的tftp软件,作为tftp客户端,向tftp服务器发送或者接收文件。可以使用tftpd64这个软件,搭建tftp服务器。
mac 的tftp服务器指令
# 启动tftpsudolaunchctl load-F/System/Library/LaunchDaemons/tftp.plistsudolaunchctl start com.apple.tftpd# 关闭tftpsudolaunchctl unload-F/System/Library/LaunchDaemons/tftp.plistsudolaunchctl stop com.apple.tftpd# 查看tftp服务器是否启动netstat-na|grep\*.69/System/Library/LaunchDaemons/tftp.plist配置文件以下配置,可按需修改。
<array><string>/usr/libexec/tftpd</string><string>-i</string><string>-l</string><string>/private/tftpboot</string></array>-i表示开启不安全模式-l表示使用syslog记录所有请求的日志/private/tftpboot则是默认共享目录
tftp172.18.25.8-cput test.txt out/test1.txtlinux的tftp服务器指令
配置文件
# /etc/default/tftpd-hpaTFTP_USERNAME="tftp"TFTP_DIRECTORY="/srv/tftp"TFTP_ADDRESS="0.0.0.0:69"TFTP_OPTIONS="--secure --create --verbose"RUN_DAEMON="yes"TFTP_OPTIONS- 关键选项:
--secure: 限制客户端只能访问TFTP_DIRECTORY目录(必须启用)。--create: 允许客户端上传文件(默认禁用)。--verbose: 输出详细日志(调试时建议启用)。--ipv4/--ipv6: 强制使用 IPv4/IPv6。--blocksize <size>: 设置传输块大小(默认 512,最大 65464)。--retransmit <timeout>: 设置重传超时(单位毫秒)。
