【TFTP工具(Trivial File Transfer Protocol)】

TFTP工具(Trivial File Transfer Protocol)使用:

一、概述

分为服务端和客户端,想要通信,一个配成服务端另一个配成客户端。TFTP 用于 UDP 端口号 69 其文件传输活动

要想使用TFTP需要的步骤:

① 本地安装客户端工具

② 服务器安装TFTP服务端工具

③ 服务端开启 TFTP服务并配置TFTP上传和下载的目录。

如何在服务器安装TFTP工具并运行?

参考链接

  1. sudo apt update

  2. sudo apt install tftp-hpa # installs the TFTP server package

  3. vi /etc/default/tftpd-hpa # configure TFTP server(也可能是/usr/share/doc/tftp-hpa,通过find找找)修改该配置文件如下所示

    TFTP_USERNAME="tftp"
    TFTP_DIRECTORY="/srv/tftp" #use the "mkdir" command by specifying the path
    TFTP_ADDRESS=":69"
    TFTP_OPTIONS="--secure"

  4. sudo chmod -R 777 /srv/tftp

  5. sudo chown -R nobody:nogroup /srv/tftp

  6. sudo systemctl restart tftpd-hpa

  7. sudo systemctl status tftpd-hpa #check the status of the ftpt server

  8. sudo systemctl enable tftpd-hpa #to start the tftp-hpa at the boot time

  9. sudo tftp localhost # test this TFTP service in TFTP SERVER # 如果您的服务器上有防火墙或网络设置,您需要确保TFTP服务器的传输端口(通常是UDP的69端口)是允许通过的。这可以通过配置防火墙规则或网络设备来实现。

  10. 尝试通过iptables打开防火墙69号端口的UDP服务,但没啥用。
    sudo iptables -A INPUT -p udp --dport 69 -j ACCEPT
    sudo iptables -A OUTPUT -p udp --sport 69 -j ACCEPT
    sudo iptables -L -n //查看设置是否生效
    service iptables save //保存对防火墙的设置

配置防火墙的我试了没啥用,因为服务器是公司的。没太多尝试。

客户端连接到指定服务器的语法:

tftp [主机名称或IP地址]

get 下载文件

put 上传文件

输入? 显示帮助参考

其他参考链接:

通过 iptables 设置防火墙,iptables的使用:iptables网络数据包工具使用指南,入门使用详解-腾讯云开发者社区-腾讯云 (tencent.com)

相关推荐
lucky-billy6 分钟前
Ubuntu 下一键部署 ROS2
linux·ubuntu·ros2
Thera77711 分钟前
【Linux C++】彻底解决僵尸进程:waitpid(WNOHANG) 与 SA_NOCLDWAIT
linux·服务器·c++
阿梦Anmory16 分钟前
Ubuntu配置代理最详细教程
linux·运维·ubuntu
云姜.30 分钟前
线程和进程的关系
java·linux·jvm
小Tomkk1 小时前
数据库 变更和版本控制管理工具 --Bytebase 安装部署(linux 安装篇)
linux·运维·数据库·ci/cd·bytebase
赌博羊1 小时前
ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32‘ not found
linux·运维·gnu
木卫二号Coding1 小时前
第七十九篇-E5-2680V4+V100-32G+llama-cpp编译运行+Qwen3-Next-80B
linux·llama
getapi1 小时前
Ubuntu 22.04 服务器的系统架构是否为 amd64 x86_64
linux·服务器·ubuntu
消失的旧时光-19431 小时前
Linux 入门核心命令清单(工程版)
linux·运维·服务器
艾莉丝努力练剑2 小时前
【Linux:文件】Ext系列文件系统(初阶)
大数据·linux·运维·服务器·c++·人工智能·算法