Difference between revisions of "TFTP"

From ArchWiki
Jump to: navigation, search
(Expand and reword a bit)
m (Run)
(17 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Category:Networking (English)]]
+
[[Category:File Transfer Protocol]]
 +
The [[Wikipedia:Trivial File Transfer Protocol|Trivial File Transfer Protocol]] (TFTP) provides a minimalistic means for transferring files.  It is generally used as a part of [[PXE]] booting or for updating configuration and firmware on devices which have limited memory such as routers and printers.
  
The [[Wikipedia:Trivial File Transfer Protoco|Trivial Fire Transfer Protocol]] (TFTP) provides a minimalistic means for transferring files.  It is generally used as a part of [[PXE]] booting or for updating configuration and firmware on devices which have limited memory such as routers and printers.
+
This article describes how to set up a tftpd server under Arch Linux using the {{Pkg|tftp-hpa}} package.
 
+
This article describes how to set up a tftpd server under Arch Linux using the {{Package Official|tftp-hpa}} package.
+
  
 
== Installation ==
 
== Installation ==
The first thing is to install the necessary package:
+
[[pacman|Install]] the package {{Pkg|tftp-hpa}} which can be found in the [[Official Repositories|official repositories]].
# pacman -S tftp-hpa
+
  
 
== Configuration ==
 
== Configuration ==
The configuration for tftpd is in {{filename|/etc/conf.d/tftpd}}
 
  
The default configuration is:
+
Create a copy of the {{ic|tftpd.service}} unit, and modify {{ic|ExecStart}} with the appropriate directory to use as the tftp root.
  
#
+
{{hc|# vim /etc/systemd/system/tftpd.service|2=
# Parameters to be passed to TFTPD
+
[Unit]
#
+
Description=hpa's original TFTP daemon
TFTPD_ARGS="-l -s /var/tftpboot"
+
  
The directory {{filename|/var/tftpdboot}} is created automatically when tftp-hpa is installed.
+
[Service]
 +
ExecStart=/usr/sbin/in.tftpd -s /srv/tftp/
 +
StandardInput=socket
 +
StandardOutput=inherit
 +
StandardError=journal}}
  
For a complete list of parameters:
+
[[Systemd#Replacing_provided_unit_files]] talks in more detail about customizing unit files.
$ man in.tftpd
+
  
 
== Run ==
 
== Run ==
To start the daemon at boot, add {{codeline|tftpd}} to the {{codeline|DAEMONS}} array in {{filename|/etc/rc.conf}}.
 
  
To start the daemon manually:
+
Start tftpd:
  # /etc/rc.d/tftpd start
+
 
or, to start without a configuration file:
+
  # systemctl start tftpd.socket tftpd.service
  # /usr/sbin/in.tftpd -l -s path/to/folder/to/export
+
 
 +
To start tftpd on boot:
 +
 
 +
  # systemctl enable tftpd.socket
 +
 
 +
See [[Systemd#Using_units]] for more information on manipulating services.

Revision as of 06:44, 6 February 2013

The Trivial File Transfer Protocol (TFTP) provides a minimalistic means for transferring files. It is generally used as a part of PXE booting or for updating configuration and firmware on devices which have limited memory such as routers and printers.

This article describes how to set up a tftpd server under Arch Linux using the tftp-hpa package.

Installation

Install the package tftp-hpa which can be found in the official repositories.

Configuration

Create a copy of the tftpd.service unit, and modify ExecStart with the appropriate directory to use as the tftp root.

# vim /etc/systemd/system/tftpd.service
[Unit]
Description=hpa's original TFTP daemon

[Service]
ExecStart=/usr/sbin/in.tftpd -s /srv/tftp/
StandardInput=socket
StandardOutput=inherit
StandardError=journal

Systemd#Replacing_provided_unit_files talks in more detail about customizing unit files.

Run

Start tftpd:

# systemctl start tftpd.socket tftpd.service

To start tftpd on boot:

# systemctl enable tftpd.socket

See Systemd#Using_units for more information on manipulating services.