Configuration of the TFTP server (xinetd)

Install all packages associated with TFTP server. Using Synaptic package Manager we install the package tftpd.

Further we check the file /etc/xinetd.conf.

# Simple configuration file for xinetd 
# 
# Some defaults, and include /etc/xinetd.d/ 

defaults 
{ 

# Please note that you need a log_type line to be able to use log_on_success 
# and log_on_failure. The default is the following : 
# log_type = SYSLOG daemon info 

}

includedir /etc/xinetd.d 

The last line shows us that services should be located on this way. Therefore I create the tftp file in /etc/xinetd.d with the following content:

service tftp                                            
{ 
    socket_type = dgram
    protocol	= udp
    wait 	= yes
    user 	= root
    server 	= /usr/sbin/in.tftpd
    server_args = -s /home/dima/Tftpboot
    disable 	= no
}

where server_args is the path to the home folder for which we change permissions for read and write:

$ chmod a+x /home/dima/Tftpboot

Then I run the command killall xinetd and let it run in debug mode with the key -d.

$ xinetd -d

Then I look at debugging. If there are any errors it is necessary to fix them. If the service TFTP starts, messages should look similar to the following:

Service defaults

        Bind = All addresses.
        Only from: All sites
        No access: No blocked sites
        No logging

Service configuration: tftp

        id = tftp
        flags = IPv4
        socket_type = dgram
        Protocol (name,number) = (udp,17)
        port = 69
        wait = yes
        user = 0
        Groups = no
        PER_SOURCE = -1
        Bind = All addresses.
        Server = /usr/sbin/in.tftpd
        Server argv = in.tftpd -s /home/dima/Tftpboot
        Only from: All sites
        No access: No blocked sites
        No logging

14/1/20@17:09:34: DEBUG: 26667 {cnf_start_services} Started service: tftp

It is very simply to check the operativity. In the next terminal we should create the file proba.txt and transfer the file within your computer using the following commands:

$ tftp localhost
$ put proba.txt

The file have to be in our home folder.