Sudoapt-getinstalltftp-hpatftpd-hpasudoapt-getinstallxinetdsudoapt-getinstallnetkit-inetd2.cd/sudomkdir/tftpboo
1. sudo apt-get install tftp-hpa tftpd-hpa
Sudo apt-get install xinetd
Sudo apt-get install netkit-inetd
2. cd/
Sudo mkdir/tftpboot
Sudo chmod 777/tftpboot
3. sudo in. tftpd-l/tftpboot
In this way, the tftp server is started. The following is a test.
4. cd/tftpboot
Touch test
Create a file
5. cd/home/usrname
Log on to another directory
6. tftp 192.168.0.59
Change to your own ip Address
> Get/tftpboot/test
Open the directory/etc/xinetd. d/
Create File tftp
Tftp content:
Service tftp
{
Disable = no
Socket_type = dgram
Protocol = udp
Wait = yes
User = root
Server =/usr/sbin/in. tftpd
Server_args =-s/tftpboot-c
Per_source = 11
CPIs = 100 2
}
Restart the service:
Sudo/etc/init. d/xinetd restart
Sudo in. tftpd-l/tftpboot
Problems and causes during installation
Symptom 1:
Tftp> get test. log
Transfer timed out.
Cause:
Tftpd service not started
Symptom 2:
Tftp> get test. log
Error code 2: Only absolute filenames allowed
Cause:
Set server_args in/etc/xinetd. d/tftpd to/etc/default/tftpd-hpa
Cat/etc/default/tftpd-hpa
# Defaults for tftpd-hpa
RUN_DAEMON = "no"
OPTIONS = "-s/home/tftpd-c-p-U 077-u tftpd"
You only need to change server_args = to the server folder you set.
Symptom 3:
Tftp> put ex070416.log
Error code 1: File not found
Cause:
The specified file does not exist; or the-c option is not specified in the tftpd startup parameter, allowing the file to be uploaded