sudo apt install xinetd tftp tftpd
vim /etc/xinetd.d/tftp
填入一下内容(根据自己用户实际情况)
service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = user_name
server = /usr/sbin/in.tftpd
server_args = /data/share/tftp
disable = no
}
port为端口号,user为host用户名,server_args 后面的路径为tftp的根目录。
sudo /etc/init.d/xinetd restart
最好在本机上先测试一下tftp服务是否能工作,在tftp的目录下新建一个test文件,登录后能否拉取。以下为测试代码。
tftp 127.0.0.1
#以下命令在tftp的终端
tftp> get test.txt
tftp> q