Ubuntu Installation TFTP-HPA

Source: Internet
Author: User
Tags chmod error code mkdir syslog firewall

Reference one:

Install TFTP-HPA on Ubuntu 12.10

1) Install TFTP-HPA,TFTPD-HPA, xinetd

sudo apt-get install tftp-hpa tftpd-hpa xinetd

2) Create and configure the TFTP file under/etc/xinetd.d/

sudo vim/etc/xinetd.d/tftp

Service TFTP
{
Socket_type = Dgram
protocol = UDP
Wait = yes
user = root
Server =/USR/SBIN/IN.TFTPD
Server_args =-s/var/lib/tftpboot-c
Disable = no
Per_source = 11
CPS = 100 2
}

-C is used to turn on the upload function.

3) configuration Tftpd-hpa

sudo vim/etc/default/tftpd-hpa

Tftp_username= "TFTP"
tftp_directory= "/var/lib/tftpboot"
Tftp_address= "0.0.0.0:69"
tftp_options= "--secure-l-c-s"


4) Set permissions for the Tftpboot folder

sudo chmod a+wr/var/lib/tftpboot


5) Restart XINETD service

sudo/etc/init.d/xinetd restart


6) If there is a problem restarting the computer.


If error code 0:permission denied is present, the Tftpboot folder does not have permissions, or the file to be uploaded and downloaded does not have permissions.

If error code 1:file not found is present, it is because the TFTP configuration file does not have add-C.

Reference two:

1. Installing the Apt-get install TFTP-HPA TFTPD-HPA
2. Build directory $ mkdir/tftpboot # This is the set up TFTP transfer directory. $ sudo chmod 0777/tftpboot $ sudo touch test.txt # test.txt file Best input content to differentiate
3. Configure $ sudo vi/etc/default/tftpd-hpa3. #/ETC/DEFAULT/TFTPD-HPA Tftp_username= "TFTP" tftp_directory= "/tftpboot" # here is your TFTPD-HPA service directory, this is where you want to build TFTP_ address= "0.0.0.0:69" tftp_options= "-l-c-S" # Here is the option,-C is the parameter that can upload the file,-S is the specified TFTPD-HPA service directory, the above has been specified
4. Restart Services $ sudo service tftpd-hpa Restart # Start the service, here to be aware of the use of the standalone service form.
5. Test $ tftp 127.0.0.1 tftp>get test.txt tftp>put test1.txt tftp>q

Reference three:

Install TFTPD-HPA on Ubuntu 12.10

1) Install TFTP-HPA,TFTPD-HPA

sudo apt-get install TFTP-HPA TFTPD-HPA

TFTP-HPA is CLIENT,TFTPD-HPA is the server

2) configuration Tftpd-hpa

sudo vim/etc/default/tftpd-hpa

Tftp_username= "TFTP"
tftp_directory= "/home/zc/tftproot"
Tftp_address= "0.0.0.0:69"
Tftp_options= "-l-c-S"

3) Set permissions for the Tftpboot folder

sudo chmod 777/home/zc/tftproot

4) Restart TFTPD-HPA service

sudo servicetftpd-hpa restart

Ps-ef |grep TFTP can see the TFTPD-HPA process

5) Testing

Build A.txt under the Tftproot

In other directories (note that the current user can manipulate the directory, otherwise get will prompt permission denied):

#tftp 127.0.0.1 or tftp localhost

Tftp>get a.txt//download files in Tftproot

Tftp>put b.txt//upload to Tftproot

Tftp>quit


Reference four:

1. Installing Tftp-server

sudo apt-get install tftpd-hpa sudo apt-get install TFTP-HPA (if the client does not need to be installed)

TFTP-HPA is the client

TFTPD-HPA is a server-side

2. Configuring the TFTP server

sudo vim/etc/default/tftpd-hpa

Change the original content to:

Tftp_username= "tftp" tftp_address= "0.0.0.0:69″tftp_directory=" tftp root "#服务器目录, you need to set permissions to 777,CHOMD 777 tftp_options="- L-c-S "

3. Restart the TFTP service

sudo service tftpd-hpa restart

4. Testing

root@xf:/home# tftp 127.0.0.1 tftp> get test.txt Received 7 bytes in 0.1 seconds tftp> put Test.txt Sent Ten bytes I n 0.0 seconds tftp> quit


Reference five:

Because debug 6410 Development Board, need to build TFTP server under the ubuntu12.04, in the network searched many Ubuntu under the configuration tftp file, found that there are more or less problems, the following is my configuration process, has been verified by the reference ... 1) Install TFTP-HPA,TFTPD-HPA, xinetd ~$ sudo apt-get install TFTP-HPA, TFTPD-HPA, xinetd 2) Create and configure TFTP files under/etc/xinetd.d/sudo ~$ VIM/ETC/XINETD.D/TFTP   1 Service tftp   2 {  3     Socket_type = Dgram   4     protocol = UDP   5     wait = yes   6     user = root   7     Server =/usr/ SBIN/IN.TFTPD   8     Server_args =-s/tftpboot-c   9     Disable = no  10   &nbs P;per_source =  11    cps =100 2  12    flags = IPv4  13}-C is used to turn on the upload function. 3) Configure TFTPD-HPA ~$ sudo vim/etc/default/tftpd-hpa      1 #/etc/default/tftpd-hpa   2    3 TFT P_username= "TFTP"   4 tftp_directory= "/tftpboot"   5 tftp_address= "0.0.0.0:69"   6 tftp_options= "-l-c-S" Where/tftpboot for TFTP shared directory 4) modify xinetd.conf file   ~$ sudo vim/etc/xinetd.conf    Defaults   6 {  7    8 # Please note this need a log_type line to be AB Le to use log_on_success   9 # and Log_on_failure. The default is the following:  10 # log_type = SYSLOG Daemon info  11   12}  13   14 #includedir/etc/xinetd.d  15 tftp dgram UDP wait nobody/usr/sbin/tcpd/usr/sbin/in.tftpd/tftpboot 5) Restart the TFTP service and test & nbsp    sudo Service tftpd-hpa restart      sudo/etc/init.d/xinetd reload      SUDO/E tc/init.d/xinetd Restart 6) native test       Create test file under/tftpboot Love       #cd/tftpboot       #echo  xuguodongaigongxia > Love       #chmod 777 love test the TFTP service:       re-open a Terminals       #tftp 127.0.0.1      tftp>get love      tftp>q     & nbsp       #ls     After exiting, view the current directory and discover that the love file is already in the current directory.    If the above settings do not work, then the SELinux will be disabled:     sudo gedit/etc/selinux/config      //If not selinux/config this file , it is created. # This file controls the state of the SELinux on the system. # selinux= can take one of the these three values: #       Enforcing-selinux security policy is enforced. #       Permissive-selinux prints warnings instead of enforcing. #       Disabled-selinux is fully disabled. Selinux=enforcing # selinuxtype= type of policy in use. Possible values are: #       targeted-only targeted network daemons is protected. #       Strict-full SELinux protection. selinuxtype=targeted change the above selinux=enforcing to: selinux=disable   disable SELINUX and reboot restart the PC


Reference VI:

1th Step:
The software required to install TFTP. First need to install TFTP-HPA,TFTPD-HPA, the former is the client, the latter is the service program, under the terminal input sudo apt-get install tftp-hpa tftpd-hpa, install TFTP-HPA and TFTPD-HPA. You will then need to install XINETD, enter the sudo apt-get install xinetd under the terminal, and install the xinetd.

2nd Step:
Configure the related service files. into the root directory of the ETC folder (cd/etc/), first look at the directory there is not a xinetd.conf file, if not a new one, some words to view the content, to see if the same as below, if inconsistent is modified, the contents are as follows:
# Simple configuration file for xinetd
#
# Some defaults, and include/etc/xinetd.d/
Defaults
{
# Please note the need a log_type line to be able to use log_on_success ont-size:12pt; "> # log_type = SYSLOG Daemon Info
}
Includedir/etc/xinetd.d

3rd Step:
Configuring the TFTP server
Command:
sudo vim/etc/default/tftpd-hpa
Modify the content to
#/ETC/DEFAULT/TFTPD-HPA
Tftp_username= "TFTP"
tftp_directory= "/tftpboot"
#这是你tftp服务器的工作目录, modify it yourself, note that when creating a new working directory, it is best to modify its permissions to 777, command sudo chmod 777/tftpboot
Tftp_address= "0.0.0.0:69"
Tftp_options= "-l-c-S"

4th Step:
Then go to the Xinetd.d folder (CD Xinetd.d), see if there is a TFTP file, if not a new one, if you have to see whether the content is consistent with the following, inconsistent is modified, the contents are as follows:
Service TFTP
{
Socket_type = Dgram
Wait = yes
Disable = no
user = root
protocol = UDP
Server =/USR/SBIN/IN.TFTPD
Server_args =-s/tftpboot
#log_on_success + = PID HOST DURATION
#log_on_failure + = HOST
Per_source = 11
CPS = 100 2
Flags =ipv4
}
Where the Server_args line is the location where the files of the configuration server are stored, that is, when TFTP is transferred, the files are searched from that folder.

5th step:
Modify the permissions for the folder you want. The folder that needs to be modified is the folder where the server file is stored in the previous step, take my profile as an example, create a folder (sudo mkdir/tftpboot), and then set it to access the most permissive (sudo chmod 777/tftpboot), You can also set the appropriate permissions.

6th step:
Restart the service. sudo service tftpd-hpa Restart, which is also a step I often neglect, after configuring the TFTP configuration file, you need to restart the xinetd, enter sudo/etc/init.d/xinetd reload in the terminal, Reload the process, enter sudo/etc/init.d/xinetd restart, and restart the service. Remember, each time you finish modifying the configuration file, you need to restart the service.
Execution order:
sudo service tftpd-hpa restart
SUDO/ETC/INIT.D/XINETD Reload
sudo/etc/init.d/xinetd restart

Summarize:
The TFTP server can be set up by the above four steps and can be tested locally first. In my profile, for example, first create a new file in/tftpboot, and then enter the content in it, and then go to a directory that is not/tftpboot (the reason is to avoid confusion, because when getting the file is, the default is to store the file you want to get in the current directory) Again, enter sudo tftp localhost in the terminal, enter the TFTP command hyphenating (where you can enter Help to view commands and commands), enter get file, if there is no prompt, the transfer is successful, and then enter Q to exit the TFTP command, In the current directory you can see a file that is consistent with the content of the file that you are creating. You can also enter a put XX in the TFTP command and upload the xx file to the server folder. If everything is OK, then one of the available TFTP servers is successfully built.
For the above test is for local testing, if you want to the other computer or development Board TFTP transfer, the terminal input sudo tftp xxx (that is, the target computer or the target Development Board IP address), but also to turn off the Ubuntu own firewall (the book said), I uninstalled the firewall directly (sudo apt-get remove iptables), because I think for Linux, the firewall may not need to put, at least so far I have not been attacked ... Of course, you want to connect with other computers or boards within the LAN, and change the IP of these machines to the same segment. Well, with the above steps, it is possible to transfer files between the computer and the Development Board via the TFTP protocol, and the current goal is to download the Linux kernel and file system to the Development Board. If a friend finds out about my shortcomings, you can bring them to me, and we can discuss them. However, it is important to emphasize that my configuration is for Ubuntu, and other systems may be different.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.