tftp服务器

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