安装TFTP服务

1
2
yum install tftp-server
yum install xinetd //TFTP是通过xintd运行的,所以需要安装Xinetd

配置tftp文件

vim /etc/xinetd.d/tftp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot //FTP文件的根目录
disable = no //缺省请况下是禁用TFTP的,所以要把yes改为no
per_source = 11
cps = 100 2
flags = IPv4
}

设置TFTP目录的访问权限

1
chmod 777 /var/lib/tftpboot

开启TFTP服务

1
[root@localhost /]# /etc/init.d/xinetd start

可能出现的问题

1.tftpd服务没有启动

2.需要把selinux禁用掉 具体方法如下:

vim /etc/selinux/config

1
2
3
4
5
6
7
8
9
10
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

把上面的SELINUX=enforcing 改为:SELINUX=disable 禁用SeLinux
然后reboot重启PC