当前位置:网站首页>unbuntu(debian)下TFTP服务器搭建及测试
unbuntu(debian)下TFTP服务器搭建及测试
2022-07-03 09:03:00 【蒙蒂锅巴】
根据一些网上的教程,自己测试了以下,可以成功传输
一、下载安装
下载安装tftp以及守护进程:
sudo apt-get install tftp-hpa tftpd-hpa xinetd
二、建立tftp文件夹
一般都是建立根目录下:
并更改权限为所有人都可以访问修改
sudo mkdir tftpboot
sudo chmod 777 tftpboot
三、修改配置文件
然后,进入目录 /etc/xinetd.d/,并在其中新建文件 tftp,把指定的内容加入到 tftp 文件中:
sudo vim /etc/xinetd.d/tftp
添加内容如下:
service tftp
{
disable = no 138
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot -c
per_source = 11
cps = 100 2
}
server_args 就是设置的tftp目录。
修改另外一个配置文件:
vim /etc/default/tftpd-hpa
内容为:
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure -l -c -s"
四、 重启tftp服务
命令如下:
sudo /etc/init.d/xinetd reload
sudo /etc/init.d/xinetd restart
sudo /etc/init.d/tftpd-hpa restart
若最后一步重启失败,参考以下方法:
tfpd-hpa重启失败解决方法
五、TFTP服务器测试
进入tftp文件夹下,新建文件test
cd /tftp
vim test
可以输入自定义内容例如:tftp test;
然后,另外打开一个终端:
输入命令:tftp 192.168.1.201
这个ip是你自己服务器主机的ip;
输入命令
get test
然后就看到test被下载下来了;
六、tftp常用命令
参数说明:
-l 是local的缩写,后跟存在于Client的源文件名,或下载Client后 重命名的文件名。
-r 是remote的缩写,后跟Server即PC机tftp服务器根目录中的源文 件名,或上传Server后重命名后的文件名。
-g 是get的缩写,下载文件时用,
-p 是put的缩写,上传文件时用,
tftp 默认占用的是69端口。
根据上述参数,tftp的命令格式如下
1、 下载
tftp –g –l B.txt –r A.txt 192.168.1.2
作用是从server中的tftp根目录下,下载文件A.txt到Client并更名为B.txt;若不更名,B.txt就改为A.txt.
tftp –g –r A.txt 192.168.1.2
不更名直接下载
2、上传
tftp -p –r B.txt 192.168.1.2
表示从Client上传文件B.txt到Server,且不更名;
上面的上传和下载不能在本地测试,需要使用开发板测试;
本地的话,使用tftp +ip
边栏推荐
- LeetCode每日一题(1362. Closest Divisors)
- LeetCode每日一题(1024. Video Stitching)
- IDEA 中使用 Hudi
- 2022-2-13 learning xiangniuke project - version control
- [point cloud processing paper crazy reading classic version 11] - mining point cloud local structures by kernel correlation and graph pooling
- Matlab dichotomy to find the optimal solution
- C language programming specification
- [advanced feature learning on point clouds using multi resolution features and learning]
- ERROR: certificate common name “www.mysql.com” doesn’t match requested host name “137.254.60.11”.
- Spark 结构化流写入Hudi 实践
猜你喜欢

CATIA automation object architecture - detailed explanation of application objects (I) document/settingcontrollers

Flink学习笔记(十一)Table API 和 SQL

State compression DP acwing 91 Shortest Hamilton path
![[kotlin learning] control flow of higher-order functions -- lambda return statements and anonymous functions](/img/a3/b442508af9b059d279cffb34dee9bf.png)
[kotlin learning] control flow of higher-order functions -- lambda return statements and anonymous functions

Temper cattle ranking problem
![[point cloud processing paper crazy reading classic version 8] - o-cnn: octree based revolutionary neural networks for 3D shape analysis](/img/fa/36d28b754a9f380bfd86d4562268c3.png)
[point cloud processing paper crazy reading classic version 8] - o-cnn: octree based revolutionary neural networks for 3D shape analysis

Vscode编辑器右键没有Open In Default Browser选项

Vs2019 configuration opencv3 detailed graphic tutorial and implementation of test code

Solve POM in idea Comment top line problem in XML file

Navicat, MySQL export Er graph, er graph
随机推荐
[point cloud processing paper crazy reading classic version 7] - dynamic edge conditioned filters in revolutionary neural networks on Graphs
【点云处理之论文狂读经典版13】—— Adaptive Graph Convolutional Neural Networks
LeetCode每日一题(1856. Maximum Subarray Min-Product)
Linxu learning (4) -- Yum and apt commands
2022-2-13 learning the imitation Niuke project - home page of the development community
Utilisation de hudi dans idea
LeetCode每日一题(1362. Closest Divisors)
Powerdesign reverse wizard such as SQL and generates name and comment
Spark structured stream writing Hudi practice
ERROR: certificate common name “*.” doesn’t match requested ho
[point cloud processing paper crazy reading classic version 8] - o-cnn: octree based revolutionary neural networks for 3D shape analysis
Win10 quick screenshot
LeetCode每日一题(2305. Fair Distribution of Cookies)
Move anaconda, pycharm and jupyter notebook to mobile hard disk
Vs2019 configuration opencv3 detailed graphic tutorial and implementation of test code
npm install安装依赖包报错解决方法
Hudi learning notes (III) analysis of core concepts
LeetCode每日一题(2212. Maximum Points in an Archery Competition)
[point cloud processing paper crazy reading frontier version 10] - mvtn: multi view transformation network for 3D shape recognition
Overview of database system