1.安装tftp-hpa、tftpd-hpa和xinetd
sudo apt install xinetd
sudo apt install tftp-hpa tftpd-hpa
2.修改xinetd.conf文件
sudo vim /etc/xinetd.conf
#xinetd.conf添加以下内容
defaults
{
}
includedir /etc/xinetd.d
3.新建tftp根目录
mkdir -p $HOME/workspace/tftpboot
chmod 777 $HOME/workspace/tftpboot
4.修改tftpd-hpa配置文件
sudo vim /etc/xinetd.d/tftp
#配置修改如下
servicetftp
{
socket_type = dgram
wait = yes
disable = no
user = root
protocol = udp
server = /usr/sbin/in.tftpd
server_args = -s /home/flyu/workspace/tftp -c
per_source = 11
cps = 100 2
flags = IPv4
}
5.重启ftfp与xinetd服务
sudo service tftpd-hpa restart
sudo service xinetd restart
6.tftp测试
ping 192.168.1.1
tftp -g -r test.txt 192.168.1.1
cat test.txt
网友评论