当前位置:网站首页>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
边栏推荐
- [set theory] order relation (chain | anti chain | chain and anti chain example | chain and anti chain theorem | chain and anti chain inference | good order relation)
- Vscode编辑器右键没有Open In Default Browser选项
- Go language - IO project
- Spark overview
- Hudi 快速体验使用(含操作详细步骤及截图)
- Save the drama shortage, programmers' favorite high-score American drama TOP10
- Computing level network notes
- LeetCode每日一题(516. Longest Palindromic Subsequence)
- Django operates Excel files through openpyxl to import data into the database in batches.
- LeetCode每日一题(1362. Closest Divisors)
猜你喜欢

Save the drama shortage, programmers' favorite high-score American drama TOP10

Django operates Excel files through openpyxl to import data into the database in batches.

2022-2-14 learning the imitation Niuke project - send email

MySQL installation and configuration (command line version)
[graduation season | advanced technology Er] another graduation season, I change my career as soon as I graduate, from animal science to programmer. Programmers have something to say in 10 years

Hudi 集成 Spark 数据分析示例(含代码流程与测试结果)

Just graduate student reading thesis

Hudi quick experience (including detailed operation steps and screenshots)

Vs2019 configuration opencv3 detailed graphic tutorial and implementation of test code

Build a solo blog from scratch
随机推荐
Spark 概述
Alibaba cloud notes for the first time
Spark structured stream writing Hudi practice
Principles of computer composition - cache, connection mapping, learning experience
Uc/os self-study from 0
Django operates Excel files through openpyxl to import data into the database in batches.
【Kotlin学习】类、对象和接口——带非默认构造方法或属性的类、数据类和类委托、object关键字
图像修复方法研究综述----论文笔记
Problems in the implementation of lenet
LeetCode每日一题(1300. Sum of Mutated Array Closest to Target)
[set theory] order relation (chain | anti chain | chain and anti chain example | chain and anti chain theorem | chain and anti chain inference | good order relation)
WARNING: You are using pip ; however. Later, upgrade PIP failed, modulenotfounderror: no module named 'pip‘
Save the drama shortage, programmers' favorite high-score American drama TOP10
Build a solo blog from scratch
【点云处理之论文狂读经典版10】—— PointCNN: Convolution On X-Transformed Points
Liteide is easy to use
MySQL installation and configuration (command line version)
Spark overview
Construction of simple database learning environment
Data mining 2021-4-27 class notes