1.安裝tftp所需的軟件socket
tftp-hpa : 是客戶端軟件; sudo apt-get install tftp-hpa tftpd-hpa : 是服務程序; sudo apt-get install tftpd-hpa xinetd : 是新一代進程守護程序。 sudo apt-get install xinetd
2.配置xinetd.conf配置文件spa
進入/etc目錄,首先看目錄中有沒有一個xinetd.conf文件,若是沒有則新建一個,有的話查看其內容:rest
hyx@hyx:tftp$ cat xinetd.conf
看是否與下面的一致,內容以下所示:code
若不一致則運行以下命令,修改成相同便可。server
# Simple configuration file for xinetd # # Some defaults, and include /etc/xinetd.d/ defaults { # Please note that you need a log_type line to be able to use log_on_success # and log_on_failure. The default is the following : # log_type = SYSLOG daemon info } includedir /etc/xinetd.d
3.配置tftpd-hpa配置文件blog
hyx@hyx:tftp$ sudo gedit /etc/default/tftpd-hpa
# /etc/default/tftpd-hpa TFTP_USERNAME="tftp" TFTP_DIRECTORY="/home/hyx/tftp" TFTP_ADDRESS="0.0.0.0:69" TFTP_OPTIONS="-l -c -s"
chmod 777 /home/hyxtftp/
4.配置tftp配置文件進程
進入/etc下面的xinetd.d文件夾,查看是否有一個tftp文件,若是沒有的話,就新建一個並輸入如下內容,若是有的話就查看內容是否與下面的一致,不一致則修改,內容以下:get
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 cps = 100 2 flags =IPv4 }
hyx@hyx:service tftpd-hpa restart hyx@hyx:/etc/init.d/xinetd reload hyx@hyx:/etc/init.d/xinetd restart