3、配置TFTP服务器 编辑vim /etc/xinetd.d/tftp文件,打开后如下图所示: 2 # description: The tftp server serves files using the trivial file transf er
3 # protocol. The tftp protocol is often used to boot diskless
4 # workstations, download configuration files to network-aware printers,
5 # and to start the installation process for some operating systems.
6 service tftp
7 {
8 disable = no //此处的默认为yes,改为no,开启tftp服务器
9 socket_type = dgram
10 protocol = udp
11 wait = yes
12 user = root
13 server = /usr/sbin/in.tftpd
14 server_args = -s /tftpboot //此处为自己建立的tftp-server共享目录,我建立的是在根目录下
15 per_source = 11
16 cps = 100 2
17 flags = IPv4
18 }4、设置自己建立的目录/tftpboot权限
[root@luokh ~]# cd /home/luokuanh/MySelf/[root@luokh MySelf]# tftp 202.115.10.48tftp> get haha
如果没有出现错误且在该路径下出现haha文件,则证明TFTP服务器建立成功。7、可能出现的错误: tftp> 后Transfer timed out:出现此错误原因是tftpd服务没有启动 tftp> 后Error code 0:Permission denied,这是由于SELinux造成的。 可以通过如下方法解决: 编辑Vim /etc/sysconfig/selinux ,然后重启虚拟机。 1
2 # This file controls the state of SELinux on the system.
3 # SELINUX= can take one of these three values:
4 # enforcing - SELinux security policy is enforced.
5 # permissive - SELinux prints warnings instead of enforcing.
6 # disabled - No SELinux policy is loaded.
7 SELINUX=disabled //改为disabled
8 # SELINUXTYPE= can take one of these two values:
9 # targeted - Targeted processes are protected,
10 # mls - Multi Level Security protection.
11 SELINUXTYPE=targeted
12
总结:本文参考了高玉龙, 白旭, 吴玮. 达芬奇技术开发基础、原理与实例[M]. 电子工业出版社, 2012.