Configure the TFTP server in Ubuntu 10.04

Source: Internet
Author: User

Step 2:
Install the software required by TFTP. First, install TFTP-HPA and tftpd-HPA. The former is the client and the latter is the service program. Enter sudo apt-Get install TFTP-HPA tftpd-hPa on the terminal, install TFTP-HPA and tftpd-hPa. Then you need to install Xinetd, enter sudo apt-Get install xinetd in the terminal, and install xinetd.

Step 2:
Configure related service files. Go to the ETC folder (CD/etc/) in the root directory and check whether there is an xinetd in the directory. CONF file. If not, create a new one. If yes, check the content to see if it is consistent with the following. If not, modify the content as follows:
# Simple configuration file for xinetd
#
# Some ults, and include/etc/xinetd. d/
Ults
{
# Please note that you need a log_type line to be able to use log_on_success ont-size: 12pt; "> # log_type = Syslog daemon info
}
Includedir/etc/xinetd. d

Step 2:
Configure the TFTP Server
Command:
Sudo Vim/etc/default/tftpd-HPA
Modify the content
#/Etc/default/tftpd-HPA
Tftp_username = "TFTP"
Tftp_directory = "/tftpboot"
# This is the working directory of your TFTP server. Modify it on your own. Note that when creating a working directory, You 'd better change the permission to 777 and run the sudo chmod 777/tftpboot command.
Tftp_address = "0.0.0.0: 69"
Tftp_options = "-l-C-s"

Step 2:
Then enter xinetd. D folder (CD xinetd. d) check whether there is a TFTP file. If not, create a new file. If yes, check whether the content is consistent with the following. If not, modify the content as follows:
Service tftp
{
Socket_type = dgram
Wait = Yes
Disable = No
User = root
Protocol = UDP
Server =/usr/sbin/in. tftpd
Server_args =-S/tftpboot
# Log_on_success + = PID host duration
# Log_on_failure + = Host
Per_source = 11
CPIs = 100 2
Flags = IPv4
}
The server_args line is used to configure the storage location of the server's files. During TFTP transmission, all files are searched from this folder.

Step 2:
Modify the permissions of the folder. The folder to be modified is the folder that stores the Server File mentioned in the previous step. Take my configuration file as an example to create a folder (SUDO mkdir/tftpboot ), then, you can set it to sudo chmod 777/tftpboot with the loose access permissions, or set it to the appropriate permissions.

Step 2:
Restart the service. Sudo service tftpd-HPA restart, which is also a step I often neglect. After configuring the TFTP configuration file, you need to restart xinetd and enter sudo/etc/init in the terminal. d/xinetd reload, reload the process, and enter sudo/etc/init. d/xinetd restart and restart the service. Remember, you need to restart the service every time you modify the configuration file.
Execution Order:
Sudo service tftpd-HPA restart
Sudo/etc/init. d/xinetd reload
Sudo/etc/init. d/xinetd restart

Summary:
After completing the preceding four steps, you can create a TFTP server. You can perform a test locally. Take my configuration file as an example. First, create a file in/tftpboot, and enter the content as needed. Then, enter a directory that is not/tftpboot (the reason is to avoid confusion, because the file to be retrieved is stored in the current directory by default), and then enter sudo TFTP localhost in the terminal, enter the TFTP Command Line (you can enter help to view the functions of the command and command) and enter get file. If no prompt is displayed, the transfer is successful, enter Q to exit the TFTP Command, and a file is displayed in the current directory. The content of the file is consistent with that of the new file. You can also enter
Put XX: Upload the XX file to the server folder. If everything is okay, an available TFTP server will be successfully built.
The above test is for local testing. If you want to transmit TFTP to another computer or Development Board, enter sudo tftp xxx (IP address of the target computer or Development Board) on the terminal ), in addition, we also need to disable the built-in firewall of ubuntu (as mentioned in the book). I directly unmount the firewall (SUDO apt-Get remove iptables), because I think for Linux, there may be no need for a firewall. At least so far I have not been attacked... Of course, if you want to connect to a computer or Development Board in another LAN for transmission, you also need to change the IP addresses of these machines to the same segment. Now, you can use the TFTP protocol to transfer files between the computer and the Development Board. The current purpose is to download the Linux kernel and file system to the Development Board. If a friend finds out my shortcomings, he can give it to me. We can also discuss it. However, I want to emphasize that all these configurations are for Ubuntu and may be different for other systems.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.