To configure the UBUNTU-TFTP server server step

Source: Internet
Author: User
Tags sendfile

steps to configure Ubuntu TFTP service:

1. Installation related software package: Ubuntu TFTP (server side), TFTP (client), xinetd
sudo apt-get install tftpd tftp xinetd

2. Setting up the configuration file
Set up a configuration file tftp under/etc/xinetd.d/
sudo vi tftp
Enter the following in the file:
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
CPS = 100 2
Flags = IPV4}
Save exit

3. Set up Ubuntu TFTP service file directory (upload file and download file location), and change its permissions
sudo mkdir/tftpboot
sudo chmod 777/tftpboot-r

4. Restart the service
sudo/etc/init.d/xinetd restart

Now that the Ubuntu TFTP service has been installed, you can test it below.


TFTP server test:

Test situation:

Problems and causes during installation
Phenomenon One:
Tftp> Get Test.log
Transfer timed out.
Reason:
TFTPD Service not started


Phenomenon Two:
Tftp> Get Test.log
Error Code 2:only Absolute filenames allowed
Reason:
The Server_args set in/ETC/XINETD.D/TFTPD is/ETC/DEFAULT/TFTPD-HPA
Cat/etc/default/tftpd-hpa
#Defaults for TFTPD-HPA
Run_daemon= "No"
options= "-s/home/tftpd-c-p-u 077-u tftpd"
When set, just change the server_args= to the server folder you set yourself.

Phenomenon Three:
Tftp> put Ex070416.log
Error Code 1:file not found
Reason:
The specified file does not exist, or the-C option is not specified in the TFTPD startup parameter, allowing the file to be uploaded

Phenomenon four (most frequently occurring problems):

Tftp> put Test2.txt
Error Code 2:access violation
Cause: TFTP server By default, it is possible to download files, when you want to upload files, you need to have the same name under the server folder, and need the appropriate read and write permissions, if you are using root, then need to read and write root to upload the file permissions, At the same time, the server folder also requires read and write permissions, file permissions of at least 666 can be.

Examples of correct practices:

File Download

The TFTP server folder path is:/tftproot

The server context folder is:


To create a new file under Tftproot:


Under Other folders (such as/opt), download the file named Test1.txt, the user is Doyoo:


As shown in the following:

There is a hint of permission denied, indicating that doyoo this user for/opt/does not write the permissions of the file, then need to give the root user permission, or into the Doyoo dedicated space for our test

User space to enter Doyoo:


This is the discovery that we can do the TFTP server download task

File Upload:

A new file named: Sendfile.txt is created:


Obviously, the file has a permission property of 644.

Now in the TFTP server also create a new file named Sendfile.txt, of course, this requires the root user to give Doyoo users the appropriate write permissions, because the upload file is the use of TFTP overwrite the original server file,

Then the image of the file that needs to be uploaded in the server is of course also required to be writable by the user Doyoo, so the same root overwrites the Sendfile.txt's permissions, which is 666.



You can see that the above is done:

1. Use the root user to modify the read and write permissions of the Doyoo user for the Tftproot folder

A new file named Sendfile.txt is created under the 2.tftproot folder.

3.sendfile.txt permissions changed to 666, if not the case, the same error code 2:access violation

After completing the key three steps above, you can upload the file:



At this point, the configuration and testing of the TFTP server is complete!


To configure the UBUNTU-TFTP server server step

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.