Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that ubuntu12.04 installs tftp and configures tftp service incorrectly

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to solve the problem of ubuntu12.04 installing tftp and configuring tftp service". In daily operation, it is believed that many people have doubts about how to solve the problem of installing tftp and configuring tftp service in ubuntu12.04. The editor consulted all kinds of materials and sorted out simple and useful operation methods. I hope it will be helpful to answer the question of "how to solve the problem of ubuntu12.04 installing tftp and configuring tftp service"! Next, please follow the editor to study!

But configured, I always have Error code 1: File not found errors, after exploration, tftpd-hpa is an enhanced TFTP server. It provides many enhancements to TFTP, and it has been ported to most modern UNIX systems

1 、 sudo apt-get install tftp-hpa tftpd-hpa xinetd

2. Establish a configuration file

Sudo vi / etc/xinetd.d/tftp

Create a new file tftp

Tftp content:

The code is as follows:

Service tftp

{

Disable = no

Socket_type = dgram

Protocol = udp

Wait = yes

User = root

Server = / usr/sbin/in.tftpd

Server_args =-s / tftpboot-c

Per_source = 11

Cps = 100 2

}

3. Establish a directory of tftp service files

Mkdir / tftpboot

Modify permission: sudo chmod 777 / tftpboot-R

4. restart the service.

After configuring the tftp configuration file, you need to restart xinetd;. Type sudo / etc/init.d/xinetd reload in the terminal to reload the process, and then type sudo / etc/init.d/xinetd restart to restart the service.

Keep in mind that every time you modify the configuration file, you need to restart the service.

5. Installation is complete! Test method:

Put a random file abc in the / tftpboot directory

Then log in to another directory and run tftp 192.168.123.202 / / replace it with your IP

Enter the tftp command line

Enter get abc to see if you can download the file, and if you can, you can also put the file.

If the Error code 1: File not found solution appears:

Sudo vi / etc/default/tftpd-hpa

# / etc/default/tftpd-hpa

TFTP_USERNAME= "tftp"

Change TFTP_DIRECTORY= "/ var/lib/tftpboot" / / to the tftpboot you want

TFTP_ADDRESS= "0.0.0.0Vol 69"

TFTP_OPTIONS= "- l-c-s" / / here are the options

Then remember to restart the service, sudo / etc/init.d/xinetd restart

If the above error persists, copy the file to / var/lib/tftpboot and try again. If successful, restart the system for the above configuration to take effect.

In the future, you can use the tftpboot you changed.

Finally, the configuration is made, and the record is as follows:

1: install services, a total of 3 services

1 sudo apt-get install tftp-hpa tftpd-hpa xinetd

2: create a new configuration file / etc/xinetd.d/tftp

1 sudo vim / etc/xinetd.d/tftp

Note: if you are not a root user, add sudo, otherwise the system will not allow tftp, resulting in an error

"/ etc/xinetd.d/tftp" E212: Can't open file for writing

Modify / etc/xinetd.d/tftp to:

The code is as follows:

Service tftp

{

Disable = no

Socket_type = dgram

Protocol = udp

Wait = yes

User = root

Server = / usr/sbin/in.tftpd

Server_args =-s / tftpboot-c

Per_source = 11

Cps = 100 2

}

Note: in line 9

Server_args =-s / tftpboot-c

The-c parameter is allowed to be uploaded, and the parameter / tftpboot is your tftp directory, which can be modified to your directory. However, the author suggests that it is convenient to use the root directory.

3: modify the configuration file / etc/default/tftpd-hpa

1 sudo vim / etc/default/tftpd-hpa

Modified to:

1 # / etc/default/tftpd-hpa

2 TFTP_USERNAME= "tftp"

3 TFTP_DIRECTORY= "/ tftpboot" / / change it to the tftpboot you want

4 TFTP_ADDRESS= "0.0.0.015 69"

5 TFTP_OPTIONS= "- l-c-s" / / here are the options

4: create a new tftpboot directory under the root directory and modify the permissions

1 mkdir / tftpboot

2 sudo chmod 777R / tftpboot

5: create a new test file test in / tftpboot

1 touch test

Important to restart the service, restart the service wherever you modify the configuration file

1 sudo / etc/init.d/xinetd reload

2 sudo / etc/init.d/xinetd restart

7: test whether the service tftp is started

Netstat-a | grep tftp

Display:

Udp 0 0 *: tftp *: *

The service is started.

8: test tftp

Enter another directory [not / tftpboot directory, such as user jyg directory]

Cd / home/jyg

The test is shown in the figure:

9: an error occurred:

[error] Error code 0: Permission denied, because the tftpboot folder does not have permissions, or the files to be uploaded and downloaded do not have permissions.

[solve] modify permissions

Sudo chmod 777-R / tftpboot

[error] Error code 1: File not found, reason 1: the specified file does not exist; reason 2:tftpd startup parameters do not specify the-c option; reason 3: there is a problem with the directory, because the default tftp directory at the time of installation is [/ var/lib/tftpboot], you can put the test file in this directory and retest it, if the guess is correct.

[solution] both reason 1 and reason 2 are easy to solve. Here only reason 3: restart the service or restart the system.

At this point, the study on "how to solve the problem of ubuntu12.04 installing tftp and configuring tftp service error" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report