2015/08/19

Install and Setup TFTP Server on Ubuntu Linux

I had installed and setup TFTP Server on Ubuntu by below steps.

Install tftpd and xinetd packages


At a terminal prompt, enter the following command to install dhcpd:

sudo apt-get install xinetd tftpd tftp

Create /etc/xinetd.d/tftp


Create /etc/xinetd.d/tftp and put this entry in it.
sudo vim /etc/xinetd.d/tftp
service tftp
{
protocol= udp
port= 69
socket_type = dgram
wait= yes
user= nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no
}


Create a tftp folder


Create a folder /tftpboot and this folder should match whatever you gave in server_args above. mostly it will be tftpboot. And modify the authority of /tftpboot.
sudo mkdir /tftpboot
sudo chmod -R 777 /tftpboot
sudo chown -R nobody /tftpboot


Restart the xinetd service


sudo service xinetd restart #for new systems
or
sudo /etc/init.d/xinetd restart #for old systems


Testing tftp server on Client site


  1. Install tftp on client site
    sudo apt-get install tftp
  2. Create a file named file.1 in /tftpboot path of the tftp server
    cd /tftpboot
    sudo dd if=/dev/sda2 of=file.1 bs=1 count=65280

  3. Obtain the ip address of the tftp server by ifconfig command. Example 192.168.1.1
  4. Link to tftp server and get file from tftp server.
    tftp 192.168.1.2
    tftp> get file.1
    Received 1024 bytes in 0.0 seconds
    tftp> quit
  1. How do I install and run a TFTP server?
  2. How to install and configure a TFTP server on 14.04

沒有留言:

張貼留言