{"id":1811,"date":"2011-11-23T13:41:24","date_gmt":"2011-11-23T19:41:24","guid":{"rendered":"http:\/\/icesquare.com\/wordpress\/?p=1811"},"modified":"2012-10-20T10:02:28","modified_gmt":"2012-10-20T15:02:28","slug":"how-to-setup-tftp-on-ubuntu","status":"publish","type":"post","link":"https:\/\/icesquare.com\/wordpress\/how-to-setup-tftp-on-ubuntu\/","title":{"rendered":"How to Setup TFTP on Ubuntu 11.10"},"content":{"rendered":"<p><img decoding=\"async\" data-attachment-id=\"2176\" data-permalink=\"https:\/\/icesquare.com\/wordpress\/how-to-setup-tftp-on-ubuntu\/tftp_small\/#main\" data-orig-file=\"https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2011\/11\/TFTP_Small.png\" data-orig-size=\"250,207\" data-comments-opened=\"1\" data-image-title=\"TFTP\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2011\/11\/TFTP_Small.png\" src=\"\/wordpress\/wp-content\/uploads\/2011\/11\/TFTP_Small.png\" alt=\"\" title=\"TFTP\" width=\"200\" class=\"alignleft size-thumbnail wp-image-2176\" \/><\/p>\n<p>Recently I decide to jump into the pool of using diskless Ubuntu. Basically the client computer downloads the necessary files from the Ubuntu server every time during the boot. To keep things simple and easy, Ubuntu does that by using TFTP. So the first step is to set up a TFTP server on the server. For those who haven&#8217;t heard of TFTP, it is similar to FTP, except that it has no security feature, and the function is extremely limited. Anyway, here is how to set up a TFTP server on Ubuntu 11.10:<\/p>\n<div style=\"clear:both;\"><\/div>\n<div class=\"alignright\"><\/div>\n<p style=\"margin:20px 20px 70px 0px; padding-right:20px;\">Installing TFTP sounds easy. However, I&#8217;ve heard that many people experienced many issues during the installation, such as <strong>Error code 2: Access violation<\/strong> issue. That&#8217;s why I create this tutorial. If you follow exact the same steps, you will not experience any problem.<\/p>\n<div style=\"margin:50px;\"><\/div>\n<p>First, let&#8217;s install all the necessary packages:<\/p>\n<pre>\r\nsudo apt-get install xinetd tftpd tftp -y\r\n<\/pre>\n<p>Next, we need to create a configuration file:<\/p>\n<pre>\r\nsudo nano \/etc\/xinetd.d\/tftp\r\n<\/pre>\n<p>Put the following content into the file.<\/p>\n<pre>\r\n\r\nservice tftp\r\n{\r\n   protocol = udp\r\n   port = 69\r\n   socket_type = dgram\r\n   wait = yes\r\n   user = nobody\r\n   server = \/usr\/sbin\/in.tftpd\r\n   server_args = var\/lib\/tftpboot -s\r\n   disable = no\r\n}\r\n<\/pre>\n<p>In the server_args, I have <strong>var\/lib\/tftpboot<\/strong>, which represents the location of the tftp root, i.e., <strong>\/var\/lib\/tftpboot<\/strong>. Notice that I skip the root \/.<\/p>\n<p>Now let&#8217;s change the ownership of the directory:<\/p>\n<pre>\r\n\r\nsudo mkdir \/var\/lib\/tftpboot\r\nsudo chown -R nobody:nobody \/var\/lib\/tftpboot\r\nsudo chmod -R 777 \/var\/lib\/tftpboot\r\n<\/pre>\n<p>and start the TFTP service:<\/p>\n<pre>\r\nsudo service xinetd stop\r\nsudo service xinetd start\r\n<\/pre>\n<p>Verify the TFTP is running correctly or not:<\/p>\n<pre>\r\nnetstat -na | grep LIST | grep 69\r\n<\/pre>\n<p>You should see something like this:<\/p>\n<pre>\r\ntcp        0      0 0.0.0.0:69              0.0.0.0:*     LISTEN\r\n<\/pre>\n<p><\/p>\n<h2>Test: Upload a file to TFTP Server<\/h2>\n<p>Now let&#8217;s test the TFTP server by logging into the server first:<\/p>\n<pre>\r\ntftp localhost\r\n<\/pre>\n<p>and upload a file:<\/p>\n<pre>\r\ntftp> put myfile.jpg\r\nSent 56733279 bytes in 5.7 seconds\r\n<\/pre>\n<p>Quit:<\/p>\n<pre>\r\nq\r\n<\/pre>\n<p>Make sure that file has been uploaded:<\/p>\n<pre>\r\nls -l \/var\/lib\/tftpboot\r\n<\/pre>\n<h2>Test: Download a file from TFTP Server<\/h2>\n<p>Now, let&#8217;s go to a different directory and download the file we just upload.<\/p>\n<pre>\r\ncd some_other_directory\r\n<\/pre>\n<p>and log in to the tftp server again:<\/p>\n<pre>\r\ntftp localhost\r\n<\/pre>\n<p>and get the file:<\/p>\n<pre>\r\ntftp> get myfile.jpg\r\nReceived 56733279 bytes in 5.7 seconds\r\n<\/pre>\n<p>You are done.<\/p>\n<h2>Troubleshooting (e.g., Error code 2: Access violation)<\/h2>\n<p>If you see a message like: <strong>Error code 2: Access violation<\/strong><\/p>\n<p>Make sure that you:<br \/>\n&#8211; Follow the exact procedure in this tutorial<br \/>\n&#8211; Make sure that the tftp is started with -s flag.<br \/>\n&#8211; Check the permission of the directory, i.e., 777<br \/>\n&#8211; After you&#8217;ve made any changes to the TFTP configuration, make sure that you stop and start the inet service again.<br \/>\n&#8211; Don&#8217;t forget to quit tftp before retrying the command.<\/p>\n<p>That&#8217;s it!<\/p>\n<p>Enjoy TFTP.<\/p>\n<p>&#8211;Derrick<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I decide to jump into the pool of using diskless Ubuntu. Basically the client computer downloads the necessary files from the Ubuntu server every time during the boot. To <a class=\"more-link\" href=\"https:\/\/icesquare.com\/wordpress\/how-to-setup-tftp-on-ubuntu\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[94,144,6,69],"tags":[132,18],"class_list":["post-1811","post","type-post","status-publish","format-standard","hentry","category-computer-problems-computer-help-pc-support","category-sever-problem","category-technology","category-troubleshooting-technology","tag-tftp","tag-ubuntu"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p1sqzr-td","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2036,"url":"https:\/\/icesquare.com\/wordpress\/solvedtftp-error-code-2-access-violation\/","url_meta":{"origin":1811,"position":0},"title":"[Solved]TFTP: Error code 2: Access violation","author":"Derrick","date":"December 13, 2011","format":false,"excerpt":"This post is an extension of my original post on TFTP: How to Setup TFTP. Although the post was written for Ubuntu, the same idea can be applied to all systems. So, here is our problem. You set up a TFTP server. It starts fine. You upload a file, it\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/icesquare.com\/wordpress\/wp-content\/uploads\/2011\/11\/TFTP_Small.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1658,"url":"https:\/\/icesquare.com\/wordpress\/upgrading-ubuntu-to-11-10-via-command-line\/","url_meta":{"origin":1811,"position":1},"title":"Upgrading Ubuntu to 11.10 via Command Line","author":"Derrick","date":"October 13, 2011","format":false,"excerpt":"Ubuntu was out today, and I could not wait to try out the new features. However I am in the office now and I have no physical access to my Ubuntu box in my kitchen, so using the graphic interface is not an option to me. I searched online and\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":686,"url":"https:\/\/icesquare.com\/wordpress\/ubuntu-10-04-cant-boot-cant-install-solved\/","url_meta":{"origin":1811,"position":2},"title":"Ubuntu 10.04 &#8211; Can&#8217;t boot \/ Can&#8217;t install &#8211; Solved","author":"Derrick","date":"May 3, 2010","format":false,"excerpt":"Since Ubuntu 10.04 is out officially, I like to give it a try on my media server. FYI, here is the specification of my media server: Athlon 64 X2 4600 Chipset: GeForce 6150 LE Motherboard: Asus A8M2N-LA Harddrive format: IDE Note that this is a 2006 model and the system\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1086,"url":"https:\/\/icesquare.com\/wordpress\/how-to-speed-up-ubuntu-on-a-low-end-computer\/","url_meta":{"origin":1811,"position":3},"title":"How to speed up Ubuntu on a Low-End computer?","author":"Derrick","date":"November 20, 2010","format":false,"excerpt":"If you think your Ubuntu box is slow. You may want to give Xubuntu a try. I have a Ubuntu box on a relative old (5+ years) laptop (HP dv1000, Pentium Celerom M + 512MB ram). I mainly use it for lightweight activity such as office and web browsing. Recently,\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":896,"url":"https:\/\/icesquare.com\/wordpress\/finally-ubuntu-uses-a-more-updated-linux-kernel-than-fedora\/","url_meta":{"origin":1811,"position":4},"title":"Finally, Ubuntu uses a more updated Linux kernel than Fedora","author":"Derrick","date":"October 11, 2010","format":false,"excerpt":"Historically, Ubuntu focuses on the user experience such as beautiful graphical user interface, while Fedora focuses on performance. In the other words, the kernel in Fedora distribution is more up-to-dated. I just upgraded by Ubuntu 10.04 to 10.10 (released on October 10, 2010), I found that the Linux Kernel in\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1511,"url":"https:\/\/icesquare.com\/wordpress\/how-to-clean-up-the-dmesg-message\/","url_meta":{"origin":1811,"position":5},"title":"How to clean up the dmesg message","author":"Derrick","date":"August 24, 2011","format":false,"excerpt":"Recently, I found that my dmesg log are filled of junk. Or I should say it contains lots of errors and complains that I already fix. However, I don't want to reboot the machine to get rid of these error messages. How can I do it? The solution is very\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1811","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1811"}],"version-history":[{"count":31,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1811\/revisions"}],"predecessor-version":[{"id":2998,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1811\/revisions\/2998"}],"wp:attachment":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}