Ubuntu10.10 install and configure the TFTP service

Source: Internet
Author: User
Tags file transfer protocol
I recently introduced the tftp-related configuration to students during the tutorial on Ubuntu10.10. Although the configuration is very simple, you can configure the tftp service in a few steps, however, I encountered a lot of problems during the course of my experiment. Therefore, I carefully searched for the reasons on the Internet and summarized the tftp configuration process, related configurations, and common errors. TFTP (TrivialFileTransferProtocol, simple File Transfer Protocol) is a TCP/IP protocol family

When I recently introduced basic courses related to Ubuntu 10.10, I told my students about the configuration of tftp. Although the configuration is very simple, I can configure the tftp service in just a few steps, however, I encountered a lot of problems during the course of my experiment. Therefore, I carefully searched for the reasons on the Internet and summarized the tftp configuration process, related configurations, and common errors.

TFTP (Trivial File Transfer Protocol, simple File Transfer Protocol) is a Protocol used in the TCP/IP Protocol family to transmit simple files between the client and the server, provides File Transfer services that are not complex and costly. The port number is 69. It is implemented based on the UDP protocol.

During our use, our TFTP service is started using the xinetd process, so let's take a look at the introduction of xinetd: xinetd, namely extended internet daemon, xinetd is a new generation of network daemon service program, also called a super Internet server. It is often used to manage a variety of lightweight Internet services. Xinetd provides functions similar to inetd + tcp_wrapper, but is more powerful and secure.

In general, if we start the tftp service, we only need to make the following Configuration:

1. Edit the/etc/xinetd. d/tftp file. This file is the configuration file supported by xinetd for the tftp service. Generally, this file contains the following content:

Service tftp
{
Socket_type = dgram
Protocol = udp
Wait = yes
User = root
Server =/usr/sbin/in. tftpd
Server_args =-s/tftpboot
Disable = no
Per_source = 11
CPIs = 100 2
Flags = IPv4
}

In general, in this configuration file, we should pay attention to the setting of the tftp server shared directory, that is, the server_args =-s/tftpboot line, we can see that this line has a parameter-s, so there are several related parameters for this configuration. Here we will introduce:

-L run in standalone mode. In this mode, the-t option is ignored.
-A address: port: the IP address and port of the service in standalone mode. If this parameter is not specified, the connection is listened on all the IP addresses of the Local Machine and the port specified in/etc/service.
-C allows you to create new files on the server. Otherwise, you can only update existing files. If the-U or-p option is not specified, anyone is allowed to upload files.
-S directory: the default directory on the server. The default directory is/var/lib/tftpdboot.
-U username: the identity of the tftp service. The default value is nobody. You can create a new tftp account to run the service.
-U umask: Specifies the File Upload mask. If-p is not specified, it is 000. If-p is specified, the specified umask is used.
-P does not perform additional permission checks on the actions performed by the user specified by-u.

2. Create a shared directory

Follow the steps below to create a tftp service shared directory according to the directory configured in the previous step:

Cd/
Sudo mkdir tftpboot
Sudo chmod-R 777 tftpboot
Cd/tftpboot
Sudo touch test
Chmod 777 test

In this step, a tftpboot directory is created, and a file named test is created under the directory for testing. Change their permissions to 777 for use.

3. Start the tftp service

Our tftp service is started by using the xinetd process, so the startup command is as follows:

Sudo/etc/init. d/xinetd restart

4. Test the tftp service

You can use ifconfig eth0 to view the local IP address and connect to the local tftp server using tftp. However, if you want to test whether the above steps are successful by using 127.0.0.1 address on the local machine:

Tftp 127.0.0.1
Tftp> get test
Received 1018 bytes in 0.1 seconds
Tftp> quit

If the test file is found in the current directory, the tftp service runs correctly.

However, even if the above steps are not properly operated, some students may encounter problems when obtaining files, the following two tips are displayed: (the solution I found on the Internet)

1: If a permission denied error occurs, the operator has insufficient permissions and the permission must be upgraded.

Su root

After the password is entered, tftp transmission can be performed normally.

2: If an Access violation error occurs, the file permission is not unlocked,

You can unlock all the file operation permissions you want to perform.

Chmod 777 file name

The first error can be corrected according to the above method, but if the second error still appears after being modified according to the above method, you can check the file/etc/inetd below. conf, and then find a line like this:

Tftp dgram udp wait nobody/usr/sbin/tcpd/usr/sbin/in. tftpd/srv/tftp

You can change the last parameter to the tftp shared directory we have set, that is:

Tftp dgram udp wait nobody/usr/sbin/tcpd/usr/sbin/in. tftpd/tftpboot

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.