Ubuntu 8.10下配置tftp 服务端
1. 安装tftp 相关软件包:tftpd (服务端),tftp (客户端),xinetd
其中,xinetd( eXtended InterNET services daemon) 新一代的网络守护进程服务程序, xinetd 对所有的服务都进行记录,日志保存到文件 /var/adm/xinetd.log 中,并且使用配置文件/etc/xinetd.conf 。
sudo apt-get install tftpd tftp xinetd
2. 建立配置文件
在/etc/xinetd.d/ 下按xinetd 要求的格式建立一个配置文件tftp 。
sudo vim tftp 在文件中输入以下内容:
service tftp {
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
保存退出, 以上配置文件/etc/xinetd.d/tftp 会被 /etc/xinetd.conf 包含进来。
3. 建立tftp 服务文件目录(上传文件与下载文件的位置),并且更改其权限
sudo mkdir /tftpboot
sudo chmod 777 /tftpboot -R ( 递归的改变其子目录)
4. 重新启动服务
sudo /etc/init.d/xinetd restart
至此,tftp 服务已经安装完成了,下面可以对其进行测试。(假设在当前目录下有一个test.txt 文件)
$tftp 127.0.0.1
tftp> put test.txt
Sent 1018 bytes in 0.0 seconds
tftp> get test.txt
Received 1018 bytes in 0.1 seconds
tftp> quit $