[Transfer]ubuntu 10.04 under configuration TFTP server

Source: Internet
Author: User

[Transfer]ubuntu 10.04 under configuration TFTP server

Http://www.cnblogs.com/geneil/archive/2011/11/24/2261653.html

1th Step:
The software required to install TFTP. First need to install TFTP-HPA,TFTPD-HPA, the former is the client, the latter is the service program, under the terminal input sudo apt-get install tftp-hpa tftpd-hpa, install TFTP-HPA and TFTPD-HPA. You will then need to install XINETD, enter the sudo apt-get install xinetd under the terminal, and install the xinetd.

2nd Step:
Configure the related service files. into the root directory of the ETC folder (cd/etc/), first look at the directory there is not a xinetd.conf file, if not a new one, some words to view the content, to see if the same as below, if inconsistent is modified, the contents are as follows:
# Simple configuration file for xinetd
#
# Some defaults, and include/etc/xinetd.d/
Defaults
{
# Please note the 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

3rd Step:
Configuring the TFTP server
Command:
sudo vim/etc/default/tftpd-hpa
Modify the content to
#/ETC/DEFAULT/TFTPD-HPA
Tftp_username= "TFTP"
tftp_directory= "/tftpboot"
#这是你tftp服务器的工作目录, modify it yourself, note that when creating a new working directory, it is best to modify its permissions to 777, command sudo chmod 777/tftpboot
Tftp_address= "0.0.0.0:69"
Tftp_options= "-l-c-S"

4th Step:
Then go to the Xinetd.d folder (CD Xinetd.d), see if there is a TFTP file, if not a new one, if you have to see whether the content is consistent with the following, inconsistent is modified, the contents are 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
CPS = 100 2
Flags =ipv4
}
Where the Server_args line is the location where the files of the configuration server are stored, that is, when TFTP is transferred, the files are searched from that folder.

5th step:
Modify the permissions for the folder you want. The folder that needs to be modified is the folder where the server file is stored in the previous step, take my profile as an example, create a folder (sudo mkdir/tftpboot), and then set it to access the most permissive (sudo chmod 777/tftpboot), You can also set the appropriate permissions.

6th step:
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 the xinetd, enter sudo/etc/init.d/xinetd reload in the terminal, Reload the process, enter sudo/etc/init.d/xinetd restart, and restart the service. Remember, each time you finish modifying the configuration file, you need to restart the service.
Execution order:
sudo service tftpd-hpa restart
SUDO/ETC/INIT.D/XINETD Reload
sudo/etc/init.d/xinetd restart

Summarize:
The TFTP server can be set up by the above four steps and can be tested locally first. In my profile, for example, first create a new file in/tftpboot, and then enter the content in it, and then go to a directory that is not/tftpboot (the reason is to avoid confusion, because when getting the file is, the default is to store the file you want to get in the current directory) Again, enter sudo tftp localhost in the terminal, enter the TFTP command hyphenating (where you can enter Help to view commands and commands), enter get file, if there is no prompt, the transfer is successful, and then enter Q to exit the TFTP command, In the current directory you can see a file that is consistent with the content of the file that you are creating. You can also enter a put XX in the TFTP command and upload the xx file to the server folder. If everything is OK, then one of the available TFTP servers is successfully built.
For the above test is for local testing, if you want to the other computer or development Board TFTP transfer, the terminal input sudo tftp xxx (that is, the target computer or the target Development Board IP address), but also to turn off the Ubuntu own firewall (the book said), I uninstalled the firewall directly (sudo apt-get remove iptables), because I think for Linux, the firewall may not need to put, at least so far I have not been attacked ... Of course, you want to connect with other computers or boards within the LAN, and change the IP of these machines to the same segment. Well, with the above steps, it is possible to transfer files between the computer and the Development Board via the TFTP protocol, and the current goal is to download the Linux kernel and file system to the Development Board. If a friend finds out about my shortcomings, you can bring them to me, and we can discuss them. However, it is important to emphasize that my configuration is for Ubuntu, and other systems may be different.

[Transfer]ubuntu 10.04 under configuration TFTP server

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.