Ubuntu Geek

Ubuntu Linux Tips,Howtos&Tutorials|Edgy,Feisty,Gutsy,Hardy,Intrepid

  • RSS Feed

    subscribe to the ubuntu Geek RSS feed


  • Sponsor



  • Categories

  • Meta

  • Sponsor

  • Archives

  • Support Ubuntugeek

    Amount $:
    Website(Optional):


  • Favourite Sites

Howto Setup advanced TFTP server in Ubuntu

Posted by admin on July 15th, 2008 Email This Post Email This Post

atftp is Multi-threaded TFTP server implementing all options (option extension and multicast) as specified in RFC1350, RFC2090, RFC2347, RFC2348 and RFC2349. Atftpd also supports multicast protocol known as mtftp, defined in the PXE specification. The server supports being started from inetd as well as in daemon mode using init scripts.

Install atftp Server in Ubuntu

sudo aptitude install atftpd

This will complete the installation

Using atftpd

By default atftpd server starts using inetd so we need to tell atftpd to run as a server directly, not through inetd.Edit /etc/default/atftpd file using the following command

sudo gedit /etc/default/atftpd

Change the following line

USE_INETD=true

to

USE_INETD=false

save and exit the file

Now you need to run the following command

sudo invoke-rc.d atftpd start

Configuring atftpd

First you need to create a directory where you can place the files

sudo mkdir /tftpboot

sudo chmod -R 777 /tftpboot

sudo chown -R nobody /tftpboot

sudo /etc/init.d/atftpd restart

Security configuration for atftp

Some level of security can be gained using atftp libwrap support. Adding proper entry to /etc/hosts.allow and /etc/hosts.deny will restrict access to trusted hosts. Daemon name to use in these files is in.tftpd.

/etc/hosts.allow /etc/hosts.deny

in.tftpd : FQD or IP

atftp client installation

Advance Trivial file transfer protocol client,atftp is the user interface to the Internet ATFTP (Advanced Trivial File Transfer Protocol), which allows users to transfer files to and from a remote machine. The remote host may be specified on the command line, in which case atftp uses host as the default host for future transfers.

sudo aptitude install atftp

That’s it you are ready to transfer your files using tftp clients

Testing tftp server

Tranfering file hda.txt from 192.168.1.100 (Client using tftp) to 192.168.1.2 (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 ruchi ruchi 223 hda.txt

atftp 192.168.1.2

atftp> put hda.txt

Sent 722 bytes in 0.0 seconds

atftp> quit

ls -l /tftpboot/

total 4
-rwxrwxrwx 1 ruchi ruchi 707 2008-07-07 23:07 hda.txt

Share/Save/Bookmark

If you want to be notified the next time we write something please subscribe to our RSS feed.Thanks for Visiting!

Related Articles

5 Responses to “Howto Setup advanced TFTP server in Ubuntu”

  1. Alex Says:

    Great job!

    Just a little mistake, maybe this command “tftp 192.168.1.2″ should be “atftp 192.168.1.2″.

  2. admin Says:

    @alex

    Thanks for your comment and i have updated the article

  3. Ivan Ruter Says:

    Very helpful - have achieved transfer from Ubuntu client to Ubuntu server (named UbuntuServer_2 with address 192.168.1.2) on in-house LAN.

    Next step is to be able to transfer from Windows XP to Ubuntu server.

    Results so far, using ‘ftp http://ftp.hostname‘ as suggested in Windows X Help:

    ftp http://ftp.UbuntuServer_2 -> Unknown host

    ftp http://ftp.192.168.1.2 -> Uknown host

    ftp 192.168.1.2 -> connected to 192.168.1.2, then after a few secs, connection closed by remote host.

    Question: any suggestions.

    Eventual aim is to be able to upload files from NuSphere phpEd (Standard) which only supports ‘passive’ FTP, installed on the Windows XP PC to the Ubuntu sever.

  4. admin Says:

    @Ivan Ruter

    If you want to transfer files from xp,any linux clients you can use ftp server on your ubuntu that is easy to transfer files

  5. andrea mucci Says:

    Hi Guys

    My Question is:

    Is possible to configure a Tftp Server for multiples domains or users.
    For example a client connet to testtftp.com the server send a response with a mail folder
    but if i connect on testtftp2.com th tfpt server send a reponse qith other folder direction

    this possible this?

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>