Wednesday 9 July 2014

TFTP - TRIVIAL FILE TRANSFER PROTOCOL (Explanation With Diagrams)

What is TFTP???

Trivial File Transfer Protocol (TFTP) is an Internet software utility for transferring files that is simpler to use than the File Transfer Protocol (FTP) but less capable. It is used where user authentication and directory visibility are not required. TFTP uses the User Datagram Protocol (UDP(using port number 69)) rather than the Transmission Control Protocol (TCP).

TFTP only reads and writes files from or to a remote server. It cannot list directories, and has no provisions for user authentication.

Installing & Configuring TFTP:

1.To install sudo apt-get install xinetd tftpd tftp





2.Create a file named tftp in the directory /etc/xinetd.d


3.The contents of the TFTP file should be 
  
service tftp
{
protocol        = udp
port            = 69
socket_type     = dgram
wait            = yes
user            = nobody
server          = /usr/sbin/in.tftpd
server_args     = /home/ashwanth/tftp_folder
disable         = no
}

NOTE: In the server-args mention the directory where you want to receive and send files using tftp


The procedure for creating the directory is 


        sudo mkdir /home/<user-name>/tftp_folder

sudo chmod -R 777 /home/<user-name>/tftp_folder
sudo chown -R nobody /home/<user-name>/tftp_folder

The permissions and ownership should be given to the directory as mentioned above.


4.To start the service the command is sudo service xinetd start

(similarly for stop and restart)

5.Then to start tftp the command is : tftp ipaddress(user you would like to connect)


6.to get a file from the other user's pc enter the command get

eg : tftp>get
     if you give get then it prompts for files
     (files)<your filename>



7.You can use quit or q command to quit.


8.The file obtained using get will be in the directory at which place you have given the command.(eg in Documents if you are in the documents directory)


The tricky part is to put a file.

   
9.First create a file using touch.

eg touch <filename>


10.Then change mode using chmod a+w <filename>


11.To put this file into the user's pc the steps 9 and 10 should be followed and a file of same filename should be created in the user's too in their tftp directory.


12.Then you can use the put command similar to the get command.  

                                   

Since the above file was empty it didnt show the sent thing ..

The new.file is a file that i have already created now you can see the difference..


AUTHOR
Ashwanth Selvam
Project Engineer


No comments:

Post a Comment