ubuntu 配置tftp服务

ubuntu 18.04 启用TFTP服务

ubuntu 下配置tftp服务,用于上传或下载网络设备中的配置文件、固件等场合,记录备忘。

安装

1
sudo apt install tftpd-hpa tftp-hpa tftp-hpa-dbg pxelinux

配置文件

  • 创建tftp服务目录
1
2
mkdir tftproot
chmod 777 tftproot
  • 修改配置文件
1
2
3
4
5
6
7
8
9
10
11
sudo cp /etc/default/tftpd-hpa /etc/default/tftpd-hpa_backup   //备份配置文件
sudo vim /etc/default/tftpd-hpa //修改配置文件

//配置如下

# /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/home/abcd/tftproot"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="-l -c -s"
  • 启用tftp服务
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
sudo service tftpd-hpa restart
sudo systemctl status tftpd-hpa //查看服务状态

● tftpd-hpa.service - LSB: HPA's tftp server
Loaded: loaded (/etc/init.d/tftpd-hpa; generated)
Active: active (running) since Thu 2019-03-28 19:44:48 CST; 16s ago
Docs: man:systemd-sysv-generator(8)
Process: 11088 ExecStop=/etc/init.d/tftpd-hpa stop (code=exited, status=0/SUCC
Process: 11093 ExecStart=/etc/init.d/tftpd-hpa start (code=exited, status=0/SU
Tasks: 1 (limit: 4915)
CGroup: /system.slice/tftpd-hpa.service
└─11101 /usr/sbin/in.tftpd --listen --user tftp --address :69 -l -c -

3月 28 19:44:48 ian-ThinkPad systemd[1]: Starting LSB: HPA's tftp server...
3月 28 19:44:48 ian-ThinkPad tftpd-hpa[11093]: * Starting HPA's tftpd in.tftpd
3月 28 19:44:48 ian-ThinkPad tftpd-hpa[11093]: ...done.
3月 28 19:44:48 ian-ThinkPad systemd[1]: Started LSB: HPA's tftp server.
lines 1-14/14 (END)

ubuntu 配置tftp服务
https://ywmy.xyz/2019/03/28/ubuntu-配置tftp服务/
作者
ian
发布于
2019年3月28日
许可协议