How to configure the tftp server in ubuntu 10.04 and how to use the tftp Command on the Development Board

Source: Internet
Author: User

Configuration of tftp server in ubuntu 10.04 and use of tftp commands on the Development Board tftp server in ubuntu 10.04: Step 4: install the software required for 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/defaults {# 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. step d: configure the tftp server command: sudo vim/etc/default/tftpd-hpa to change the content to #/et C/default/tftpd-hpa TFTP_USERNAME = "tftp" TFTP_DIRECTORY = "/tftpboot" # This is the working directory of your tftp server. Modify it by yourself. Note that when creating a working directory, it is recommended to modify the permission to 777. Run the sudo chmod 777/tftpboot TFTP_ADDRESS = "0.0.0.0: 69" TFTP_OPTIONS = "-l-c-s" Step 4th: 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 cps = 100 2 flags = IPv4} The server_args line is used to configure the storage location of server files, that is, when tftp transmission is performed, all files are searched from this folder Step 1: modify the permissions of the required 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 restartsudo/etc/init. d/xinetd reloadsudo/etc/init. d/xinetd restart conclusion: you can build a tftp server through the above four steps. You can perform a test locally first. 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 input put xx in the tftp Command to 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. How to use tftp on the Development Board: Usage: tftp [OPTION]... HOST [PORT] Transfer a file from/to tftp server Options: -l FILE Local FILE-r FILE Remote FILE-g Get file-p Put file-B SIZE Transfer blocks of SIZE octets [root @ FriendlyARM] # tftp-l/home/test. c-r/test. c-g 192.168.1.103 Note: It indicates/tftpboot/test on the remote host. c. download it to the/home/directory of the Development Board and change it to test. c file... -L: localhost-r: remote-g: get 192.168.1.103 is the same as the remote host ip address. to upload a local file to the remote server, set-g to-p, p indicates put...
 

Related Article

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.