TFTP is the simplest network protocol used to download remote files. it is implemented through UDP protocol. install the two software tftp-0.49-7.el6.i686 (TFTP client software) tftp-server-0.49-7.el6.i686 (TFTP server software) # yuminstalltftp # yuminstalltftp-server2. modify the startup configuration file no matter which super-server, inetd or xinet is used
TFTP is the simplest network protocol used to download remote files. it is implemented through UDP.
1. install two software
Tftp-0.49-7.el6.i686 (TFTP client software)
Tftp-server-0.49-7.el6.i686 (TFTP server software)
# Yum install tftp
# Yum install tftp-server
2. modify the startup configuration file
No matter which super-server, inetd, or xinetd is used, the TFTP service is disabled by default, so you need to modify the file to enable the service. Modify the file/etc/xinetd. d/tftp, mainly to set the root directory of the TFTP server and enable the service.
The modified configuration file is as follows:
Service tftp
{
Disable = no
Socket_type = dgram
Protocol = udp
Wait = yes
User = root
Server =/usr/sbin/in. tftpd
Server_args =-s/tftpboot-c # specifies the Directory of the tftp server, and-c indicates that files can be created
Per_source = 11
CPIs = 100 2
Flags = IPv4
}
3. create the tftp root directory, disable the firewall, and start the tftp-server
# Mkdir-m 777/tftpboot
#/Etc/init. d/iptables stop // disable the firewall
# Service xinetd restart // restart the xinetd service to restart the xinetd service. because the TFTP service is controlled by the xinetd service, the xinetd service is managed by the service and does not open the port.
Verify whether TFTP is up:
[Root @ kashu/] # netstat-tunap | grep: 69
The following information indicates that
Udp 0 0 0.0.0.0: 69 0.0.0.0: * 1258/xinetd
4. Use of tftp
# Tftp 192.168.2.105 login to tftp server
> Get filename: get the file from the tftp server root directory
> Put filename: upload the file to the tftp server root directory.
> Q exit
Problems and causes during installation
Question 1
Tftp> get
Transfer timed out.
Cause:
Tftpd service not started
Solution:
# Service xinetd status: check the tftp running status. if the service is not enabled, run the following statement:
# Service xinetd start
Question 2
Tftp> put
Error code 0: Permission denied
Cause:
Run the command to view system logs.
# Tail/var/log/messages
The following text is found:
Mar 24 19:05:26 localhost setroubleshoot: SELinux is preventing/usr/sbin/in. tftpd (tftpd_t) "write" to tftpboot (reboot). For complete SELinux messages. run sealert-l handle
This is caused by SELinux. SELinux is enabled by default in FC versions after FC3 and FC3.
Solution:
Modify the/etc/sysconfig/selinux file, set SELINUX = disabled, and then restart the computer. Or run the system-config-securitylevel command to open the "security level configuration" dialog box and change "force" in SELinux (S) to "allow ".
Question 3
Tftp> put
Error code 1: File not found
Cause:
The specified file does not exist;
Solution:
/Etc/xinetd. d/server_args in tftp does not contain this file in the directory specified by server_args. you can copy the file to be downloaded to this directory, or server_args is set by yourself instead of the default/tftpboot, however, The-c option is not specified later. just add it.
Question 4
Tftp> get test. log
Error code 2: Only absolute filenames allowed
Cause:
Set server_args in/etc/xinetd. d/tftpd to/etc/default/tftpd-hpa
Cat/etc/default/tftpd-hpa
# Defaults for tftpd-hpa
RUN_DAEMON = "no"
OPTIONS = "-s/home/tftpd-c-p-U 077-u tftpd"
You only need to change server_args = to the server folder you set.