安装相关软件包:tftpd ftp xinetd
$sudo apt-get install tftpd tftp xinetd
建立tftp服务文件目录并且更改其权限
$cd /
$sudo mkdir tftpboot
$sudo chmod 777 tftpboot -R
修改/etc/inetd.conf配置文件中tftp专用目录的地址
$sudo vim /etc/inetd.conf
将如下内容
# # sane-port stream tcp nowait saned:saned /usr/sbin/saned saned
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /srv/tftp
改成如下:
# # sane-port stream tcp nowait saned:saned /usr/sbin/saned saned
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot
在/etc/xinetd.d/下建立一个名为tftp配置文件
$sudo vim /etc/xinetd.d/tftp
在文件中输入以下内容:
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
}
重新启动服务
$sudo /etc/init.d/xinetd restart