2020-04-17 13:58:34 +08:00
|
|
|
# TFTP 服务安装和配置
|
|
|
|
|
|
|
|
## 安装
|
|
|
|
|
2020-05-20 16:18:39 +08:00
|
|
|
```bash
|
2020-04-17 13:58:34 +08:00
|
|
|
# Ubuntu
|
2022-04-29 13:20:16 +08:00
|
|
|
sudo apt install tftpd-hpa
|
2020-05-11 15:48:07 +08:00
|
|
|
# Manjaro
|
|
|
|
sudo pacman -S tftp-hpa
|
2020-04-17 13:58:34 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
## 配置
|
|
|
|
|
2020-05-20 16:18:39 +08:00
|
|
|
```bash
|
2020-05-11 15:48:07 +08:00
|
|
|
# Ubuntu
|
2020-04-17 13:58:34 +08:00
|
|
|
sudo vim /etc/default/tftpd-hpa
|
2020-05-11 15:48:07 +08:00
|
|
|
# Manjaro
|
|
|
|
sudo vim /etc/conf.d/tftpd
|
2020-04-17 13:58:34 +08:00
|
|
|
```
|
|
|
|
|
2020-05-11 15:48:07 +08:00
|
|
|
Ubuntu 系统修改为如下内容:
|
2020-04-17 13:58:34 +08:00
|
|
|
|
2020-05-20 16:18:39 +08:00
|
|
|
```ini
|
2020-04-17 13:58:34 +08:00
|
|
|
TFTP_USERNAME="tftp"
|
|
|
|
TFTP_DIRECTORY="<your tftp share directory>"
|
|
|
|
TFTP_ADDRESS=":69"
|
|
|
|
TFTP_OPTIONS="-l -c -s"
|
|
|
|
#TFTP_OPTIONS="--secure"
|
|
|
|
```
|
|
|
|
|
2020-05-11 15:48:07 +08:00
|
|
|
Manjaro 系统修改为如下内容:
|
|
|
|
|
2020-05-20 16:18:39 +08:00
|
|
|
```ini
|
2020-05-11 15:48:07 +08:00
|
|
|
TFTPD_ARGS="-l -c -s /home/rick/Share/tftp"
|
|
|
|
```
|
|
|
|
|
2020-04-17 13:58:34 +08:00
|
|
|
## 使能/启动 TFTP 服务
|
|
|
|
|
2020-05-20 16:18:39 +08:00
|
|
|
```bash
|
2020-05-11 15:48:07 +08:00
|
|
|
# Ubuntu
|
2020-04-17 13:58:34 +08:00
|
|
|
sudo systemctl enable tftp-hpa
|
|
|
|
sudo systemctl start tftp-hpa
|
2020-05-11 15:48:07 +08:00
|
|
|
# Manjaro
|
|
|
|
sudo systemctl enable tftpd
|
|
|
|
sudo systemctl start tftpd
|
2020-04-17 13:58:34 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
## 停止/禁用 TFTP 服务
|
|
|
|
|
2020-05-20 16:18:39 +08:00
|
|
|
```bash
|
2020-05-11 15:48:07 +08:00
|
|
|
# Ubuntu
|
2020-04-17 13:58:34 +08:00
|
|
|
sudo systemctl stop tftp-hpa
|
|
|
|
sudo systemctl disable tftp-hpa
|
2020-05-11 15:48:07 +08:00
|
|
|
# Manjaro
|
|
|
|
sudo systemctl stop tftpd
|
|
|
|
sudo systemctl disable tftpd
|
2020-04-17 13:58:34 +08:00
|
|
|
```
|