Simple, read-only TFTP server.
Go 1.17 or later
go install github.com/xyproto/teaftp@latest
Navigate to the directory where you intend to share files:
With sudo:
sudo ./teaftp
On Linux, you can teaftp
it to /usr/bin
and grant additional capabilities using setcap
:
sudo install -Dm755 teaftp /usr/bin/teaftp
sudo setcap cap_net_bind_service=+ep /usr/bin/teaftp
Starting the server:
teaftp
To build the Docker container and copy the contents of the static
directory to /srv/tftp
inside the container:
docker build . -t teaftp
To run TeaFTP with Docker:
docker run --network=host -t teaftp
To run TeaFTP with Docker and serve on port 9000 instead of port 69:
docker run -ePORT=9000 --network=host -t teaftp
You can pass allowed filename suffixes as arguments to TeaFTP. When no arguments are given, there's no restriction on the file suffixes.
Example:
sudo ./teaftp ".txt"
This configuration will only serve filenames that end with .txt
.