Configuration of TFTP server in Ubuntu

Source: Internet
Author: User

Configure the IP address of eth0 and activate the device.

# Ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up

1. Install tftpd and related packages.

$ Sudo apt-Get install xinetd tftpd TFTP

2. Create/etc/xinetd. d/TFTP and put this entry:

Service tftp
{
Disable = No
Socket_type = dgram
Protocol = UDP
Wait = Yes
User = root
Server =/usr/sbin/in. tftpd
Server_args =-S/tftpboot
Per_source = 11
CPS = 1002
Flags = IPv4
}

3. Make/tftpboot directory

$ Sudo mkdir/tftpboot
$ Sudo chmod 777/tftpboot

Set/etc/init. d/atfpd
Change true in if ["$ use_inetd" = "true"] to false.

4. Start tftpd through xinetd

$ Sudo/etc/init. d/xinetd restart

5. Testing. tranfering file hda.txt from 192.168.1.100 (client using TFTP) to 192.168.1.100 (server 192.168.1.100). Get an example file to transfer (eg. hda.txt)

$ Touch/tftpboot/hda.txt

$ Chmod 777/tftpboot/hda.txt

$ LS-L/tftpboot/
Total 0

-Rwxrwxrwx 1 Davids 0 2006-03-27 23:04 hda.txt

$ TFTP 192.168.1.100

TFTP> put hda.txt
Sent 722 bytes in 0.0 seconds
TFTP> quit
$ LS-L/tftpboot/
Total 4
-Rwxrwxrwx 1 Davids 707 hda.txt

Http://hi.baidu.com/wwwkljoel/blog/item/af42f612ade9905bf919b856.html

[Note]

If the download from the TFTP server fails,

Make sure that the root directory of the server has executable permissions.

$ Chmod-r 777 TFTP

Files can be downloaded normally during use,

$ TFTP 192.168.1.222
TFTP> Get zimage
Received 1692890 bytes in 0.2 seconds

However, the file fails to be uploaded,

Error message:

TFTP> put dic.txt
Error Code 2: access violation

If you turn to Google for help, you need to explain in the following section to solve the problem.

The TFTP man page says:

Because there is no user-login or validation within the TFTP
Protocol, the remote site will probably have some sort
File-access restrictions in place. The exact methods are
Specific to each site and therefore DIF ficult to document here.

So apparently the site you're trying to get the file from has some
Kind of access restrictions in place. Take a look at the tftpd man
Page on the remote host. The Linux tftpd manual says, in part, "due
The lack of authentication information, tftpd will allow only publicly
Readable files to be accessed. files may be written only if they
Already exist and are publicly writable ."

The above mainly means that the TFTP server lacks the necessary authentication,

Therefore, only files can be downloaded by default. to upload files, the files with the same name must already exist on the server,

The file permission can be overwritten.

Therefore, create a file with the same name as the file to be uploaded in the service and change the permission.

$ Touch dic.txt

$ Chmod 777 dic.txt

Upload again.
TFTP> put dic.txt
Sent 13770 bytes in 0.0 seconds

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.