The task was performed on a server with the Debian operating system, but it will work similarly on Ubuntu Linux.
Some phones and other network equipment require a tftp server with convenient file administration in the directory to update firmware, config updates, and so on.
For TFTP servers, we use 3 different methods:
- Programmatic support tftpd tftp launch-through inetd.
- server tftpd-hpa
- DNSMASQ Instruction server: Installation and configuration of Dnsmasq server: DNS, DHCP and TFTP servers
To administer the content in the TFTP folder, we use an FTP server. vsftpd.
Create a user. tftpuser team:
adduser tftpuser
We enter a password when requesting and be sure to write the password into a notebook with passwords.
Create a folder where the tftp server files will be located by the command:
mkdir -p /home/tftpuser/tftp
We give the rights to the folder to our user team:
chown -R tftpuser:tftpuser /home/tftpuser/tftp
Now let's get to the setup.
Method No. 1
Install the TFTP server and TFTP client with the command:
aptitude install tftpd tftp
In the file. /etc/inetd.conf change:
was:
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /srv/tftp
became:
tftp dgram udp wait tftpuser /usr/sbin/tcpd /usr/sbin/in.tftpd /home/tftpuser/tftp
After that, we apply the settings overload. inetd team:
invoke-rc.d openbsd-inetd restart
TFTP server tftpd is installed and running.
Method 2
Install the TFTP server and TFTP client with the command:
aptitude install tftpd-hpa tftp
To do this, we modify the file:
vi /etc/default/tftpd-hpa
was:
TFTP_USERNAME="tftp" TFTP_DIRECTORY="/srv/tftp" TFTP_ADDRESS="0.0.0.0:69" TFTP_OPTIONS="--ipv4 --secure"
became:
TFTP_USERNAME="tftpuser" TFTP_DIRECTORY="/home/tftpuser/tftp" TFTP_ADDRESS="0.0.0.0:69" TFTP_OPTIONS="--ipv4 --secure"
In the configuration file, I changed the folder containing the files of the user, and also added the parameter -ipv4. You can also use the following parameters if you need:
- --createAllows the server to create new files,
- --ipv4 Prescribes it to expect connections only on IPv4 addresses.
- --umask 027 Resets the entry bit for the group and all access bits for other users
- --permissive requires no verification of access rights to the file in excess of those made by the operating system.
TFTP server tftpd-hpa is installed and running.
To check the work, you can create a file in the tftp folder of the server by the command:
echo Tested file > /home/tftpuser/tftp/testfile.txt && chown tftpuser /home/tftpuser/tftp/testfile.txt
Download our test file with the team:
echo get testfile.txt | tftp 127.0.0.1
Tftp server works on UDP protocol on port 69, so you need to open a firewall (if it is used) using the UDP protocol 69 port.
If the firewall is not used, our tftp server is available on both 127.0.0.1 and an external IP server, such as 192.168.1.1
Install vsftpd to administer the content of our tftp server by command:
aptitude install vsftpd
Make changes to the configuration file /etc/vsftpd.conf ftp server vsftpd:
vi /etc/vsftpd.conf было: anonymous_enable=YES стало: #anonymous_enable=YES было: #local_enable=YES стало: local_enable=YES было: #write_enable=YES стало: write_enable=YES было: #chroot_local_user=YES стало: chroot_local_user=YES
Save changes to the Vim editor by entering :wq
Reboot the ftp server vsftpd command:
/etc/init.d/vsftpd restart
FTP server vsftpd for administration of content tftp server installed, you can connect to the ftp server using a ftp client, such as TotalComander or Filezilla.
The task is completed, the tftp server is installed and ftp server vsftpd is set up for administration.




comment