linux tftp configuration (Ubuntu18.04)

    1. Tftp install the client and server
      sudo install tftp-APT-GET HPA tftpd-hpa xinetd
      tftp-HPA is a client
      tftpd-hpa server
    2. Profiles
    3. sudo vim /etc/xinetd.d/tftp
      . 1  -Service TFTP
       2  {
       . 3          socket_type = dgram
       . 4          Protocol = UDP
       . 5          the wait = Yes
       . 6          User = SEN # server using the user name
       . 7          Server = / Home / aishanliang / tftp_share server resources # Pick Path
       . 8          the server_args = -s / TFTP - C
       . 9          disable = NO
       10          per_source = . 11 
      . 11          CPS = 100  2 
      12 is         flags           = IPv4
      13 }
    4. sudo vim /etc/default/tftpd-hpa
      . 1 TFTP_USERNAME = " TFTP " 
      2 TFTP_DIRECTORY = " / Home / aishanliang / tftp_share "         # Pick Path server resources
       . 3 TFTP_ADDRESS = " : 69 " 
      . 4 TFTP_OPTIONS = " --secure "         # Write study, as used herein, does not change the default
    5. Creating a server resource folder
      sudo mkdir / home / sen / tftp_share

                     6. Use the chmod command set for the directory the most liberal permissions.

                         sudo chmod -R 777 tftp_share

                         sudo chown -R nobody tftp_share

                   7. Restart Service

       sudo service tftpd-hpa restart

       sudo /etc/init.d/xinetd restart

      8. Test

      

  •         Detecting whether obtained through ping
  •         If the firewall is turned off

           sudo ufw disable

  •         Detecting whether to start tftp

           netstat -a | grep tftp
        when the results show: udp 0 0 *: tftp: the tftp service is started

  •         In / home / sen / tftp_share create a test file and written information

          touch test
          echo “hello” > test
          cat test

  •         ifconfig view the current virtual machine IP

        The assumption is 192.168.13.59
        in another file folder with a virtual machine download tftp tftp server resource file folder test

 

       With the ls command to view the current folder, and then test to see if tftp configuration is successful.

  1. Tftp transmission from the board: After you install Ubuntu tftp, files can be downloaded using the tftp command development board.
  • tftp -g -r < filename > < ip address >

Method Two:

1. Install
$ apt-get install tftp-hpa tftpd-hpa
 
2. Create a directory
$ Mkdir / tftpboot # This is to establish tftp transfer directory.
$ sudo chmod 0777 /tftpboot
$ Sudo touch test.txt # test.txt file in order to distinguish the best typing
 
3. Configuration
# vi /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY = "/ tftpboot" # Here is your tftpd-hpa service catalog, where all want to build this line
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS = "- l -c -s" # Here is an option, -c parameters can upload files, -s is specified tftpd-hpa directory service, already specified above
 
4. Restart Service
$ Sudo service tftpd-hpa restart # start the service, here to note that the use of independent service form.
 
5. Test
# cd /home
# Tftp localhost #localhost Local host
tftp> get test.txt //test.txt before new in the / tftpboot directory file
tftp> put test1.txt //test1.txt is in the / home directory create a file
tftp>q
After the exit, in the / home directory will have a test.txt file, there test1.txt in the / tftpboot directory, tftp server installation represents a success!

For more information see the Ubuntu Ubuntu  topic page  http://www.linuxidc.com/topicnews.aspx?tid=2

This article permanently updated link address : http://www.linuxidc.com/Linux/2016-07/133255.htm

Guess you like

Origin www.cnblogs.com/tansuoxinweilai/p/11617669.html