1 安装tftp服务器
sudo apt-get install tftpd-hpa
2 安装tftp客户端
sudo apt-get insatll tftp-hpa
3 建立服务器目录
简单举例:
mkdir /tftpfs
chmod 777 /tftpfs
4 配置tftp服务器
sudo vi /etc/default/tftpd-hpa
# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpfs"
TFTP_ADDRESS="[::]:69"
TFTP_OPTIONS="-l -c -s" #-c 可以上传文件的参数 -s 指定tftpd-hpa服务目录
5 重新启动tftp服务器
sudo service ftfpd-hpa restart
6 测试tftp
tftp 192.168.2.11(本机ip)
hhp@ubuntu:~$ tftp 192.168.2.11
tftp> put testfile #下载测试文件
tftp> quit #退出tftp
查看文件是否下载成功
hhp@ubuntu:~$ ls /tftpfs/
testfile
hhp@ubuntu:~$