目录
TFTP介绍
TFTP (Trivial File Transfer Protocol)是做嵌入式常用到的一种文件传输服务,尤其是在下载ROM的时候,uboot常带有的一种内置服务。
一、安装
需要安装三个东西
sudo apt-get install xinetd tftpd tftp
二、配置
- 创建一个文件
sudo vi /etc/xinetd.d/tftp
- 复制写入以下内容并保存
service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /tftproot
disable = no
}
- 创建一个tftp传输用的目录
sudo mkdir /tftproot #跟上面/etc/xinetd.d/tftp配置文件里的路径要一致
sudo chmod -R 777 /tftproot
sudo chown -R nobody /tftproot
- 重新启动xinetd
sudo service xinetd restart
三、测试
- 创建一个测试文件
echo "tftp test hello world" > /tftproot/test.txt
- 测试
cd /tmp #避免产生垃圾文件
tftp localhost #登录
tftp> get test.txt #下载
Sent xxx bytes in 0.0 seconds
tftp> quit #退出
cat test #检查文件
http://xzh.i3geek.com
0 条评论