After learning about some basic content of the tftp server, we should begin to learn how to build the tftp server. Next, we will make a simple summary of this building process. I hope you can understand this part through the content of this article.
Set up a tftp server 1. Check whether the tftp server software is installed in the system:
[Root @ localhost lqm] # rpm-qa | grep tftp
Tftp-0.39-2
Tftp-server-0.39-2
Tftp server Construction 2. edit the file:/etc/xinetd. d/tftp
[Root @ localhost xinetd. d] # vi tftp
# 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/home/lqm/tftpboot-c
Disable = yes --------------- change yes to no!
Per_source = 11
CPIs = 100 2
Flags = IPv4
Note: The Modification Item server_args =-s-c can be changed to the root directory of your tftp-server, the parameter-s specifies chroot, and-c specifies that files can be created.
Build a tftp Server 3. Create a tftp folder
# Mkdir/home/lqm/tftpboot
# Chmod o + w/home/lqm/tftpboot
/Etc/init. d/iptables stop // disable the Firewall
Service xinetd restart // restart the xinetd service
Restart the xinetd service because the TFTP service is controlled by xinetd. xinetd is a service that manages services and does not open ports.
Verify whether TFTP is up:
[Root @ localhost tftp_root] # netstat-nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
Tcp 0 0: 22: * LISTEN 2828/sshd
Udp 0 0 0.0.0.0: 69 0.0.0.0: * 10887/xinetd
Udp 0 0 0.0.0.0: 69 0.0.0.0: * 10863/in. tftpd
Udp 0 0 0.0.0.0: 69 0.0.0.0: * 10778/in. tftpd
Port 69 is enabled, indicating that the service is started properly.
# Service xinetd restart
In this way, tftp-server is started. You can log on to the local machine to test the following command:
# Tftp your-ip-address
Tftp> get <download file>
Tftp> put <upload file>
Tftp> q
#