1 摘要

基于ubuntu18.04搭建tftp服务器

2 安装应用包

sudo apt-get install tftp-hpa tftpd-hpa

3 建立并修改tftp配置文件

sudo vi /etc/default/tftpd-hpa

在/etc/default/tftpd-hpa文件中添加如下内容

# /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/home/hhp/imx6/tftp"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure -L -c -s"

  TFTP_DIRECTORY="/home/hhp/imx6/tftp" 根据实际情况,修改为自己需要的tftp目录

4 重启服务

sudo service tftpd-hpa restart

 

# tftp -pl a 192.168.70.85
tftp: server error: (1) File not found

上传文件失败的原因,一般是TFTP_OPTIONS选项的问题,注意是TFTP_OPTIONS="--secure -L -c -s"

参考链接:

https://jingyan.baidu.com/article/49711c617b000ffa451b7c52.html