Wednesday, August 24, 2011

Using tftp in Ubuntu 10.10

I tried to use tftp in ubuntu 11.04 but it was giving error. Maybe the support for ubuntu at the time of writing this blog is not available. So I tried using tftp in ubuntu 10.10 and it worked. So what you need to use tftp.

First you need to install tftp. For that use this command:-
$sudo apt-get install tftpd-hpa

Now the default directory which will be accessed while doing tftp to the server is having location address as :-
/var/lib/tftpboot
You can get this address by viewing the contents of tftpd-hpa file present at location "/etc/default/tftpd-hpa"

Now add all the files which you want to be accessed via tftp in this directory. This directory will appear as the parent directory.
Make sure you have given proper permissions to the files to be accessed.

Now simply goto command prompt and type "tftp <server_ip_address>" like "tftp localhost"
Now you will get a prompt as "tftp>""
Here you can write the commands.

For getting the file, type "get <filename_on_server>  <filename_to_be_used_o_client>" like:-
tftp> get rahul.txt new.txt

Now this file will be copied to you computer. It will be in the directory in which you are currently in. I.E. when you do tftp <host>, the directory in which you are there at that time, the file is copied to that directory.

Similarly to put the files on the tftp server, you need to use the command "put "filename" "server_path" "

To exit from the tftp command prompt, simply type "quit" and you will exit from it.

One thing to be kept in mind is that the path for tftp server starts from the tftpboot directory. So if you have rr directory inside tftpboot directory and want to access any file inside rr, then you have to specify the path as /rr/<filename>. Therefore, the default path starts from the tftpboot directory.

If you have any queries, then do comment, I would be happy to help...... :)

No comments:

Post a Comment