Thursday, October 9, 2014

Install TFTP Server in Ubuntu

Configure TFTP server under Ubuntu Linux server to backup configuration files and IOS from networking devices. In this tutorial I am going to install and configure tftpd-hpa.
  1. Install the tftpd-hpa package

  2. [root@glt ~]# sudo apt-get install tftpd-hpa
  3. Edit tftpd-hpa config file

  4. [root@glt ~]# sudo vi /etc/default/tftpd-hpa
    # /etc/default/tftpd-hpa

    TFTP_USERNAME="tftp"
    TFTP_DIRECTORY="/tftpboot"
    TFTP_ADDRESS="0.0.0.0:69"
    TFTP_OPTIONS="-s -c -4"
    -s Prevents the remote host from passing along the directory as part of the transfer.
    -c Allow new files to be created.
    -4 Connect with IPv4 only.
  5. Create TFTP folder.

  6. [root@glt ~]# sudo mkdir /tftpboot
    [root@glt ~]# $ sudo chmod -R 777 /tftpboot
    [root@glt ~]# $ sudo chown -R nobody /tftpboot
    
  7. Restart the tftpd-hpa service.

  8. [root@glt ~]# sudo service tftpd-hpa restart
  9. Verify that the tftpd-hpa service is running.

  10. [root@glt ~]# ps -ef | grep tftp
    root     16177     1  0 20:42 ?        00:00:00 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 -s -c -4 /tftpboot