网上对于TFTP的见解有很多,有兴趣的可以查看下,我就不多说了,我就聊下关于安装TFTP的一些细节
- 检查服务器的环境(我的是centos7)
1.1 关闭防火墙
systemctl stop iptables
[root@server-16 test]# cat /etc/selinux/config
SELINUX=disabled
SELINUXTYPE=targeted
然后重启服务器生效配置 - 安装TFTP服务器
我的是通过yum装:
yum install xinetd
yum install tftp
yum install tftp-server - 配置TFTP的配置文件
如下是我的配置请参考:
[root@server-16 test]# cat /etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
protocol = udp
port = 69
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /data/tftpboot -c #这里可以改为你的tftp-server目录
disable = no
per_source = 11
cps = 100 2
flags = IPv4
} - 启动服务器
[root@server-16 ~]# in.tftpd -s /data/tftpboot/ -c
查看tftp进程
[root@server-16 ~]# ps -aux | grep tftp
root 1827 0.5 0.0 11004 844 pts/1 S+ 16:11 0:00 in.tftpd -s /data/tftpboot/ -c
root 1830 0.0 0.0 112728 992 pts/2 R+ 16:11 0:00 grep --color=auto tftp
接着启动TFTP:
[root@oracledb tftpboot]# systemctl start xinetd
[root@oracledb tftpboot]# systemctl start tftp
[root@oracledb tftpboot]# systemctl start tftp.service
[root@oracledb tftpboot]# netstat -a | grep tftp
udp 0 0 0.0.0.0:tftp 0.0.0.0:*
udp6 0 0 [::]:tftp [::]😗
以上就完成了 - tftp上传/下载文件
[root@oracledb tftpboot]# tftp 192.168.132.114
tftp> get
1.txt 1.txt] my.cnf
tftp> get my.cnf
tftp> put my.cnf
以上就是TFTP整个安装使用过程