在CentOS 5.3下安装配置tftp服务

zhengyshan 2010-07-25

在CentOS 5.3下安装配置tftp服务 过程如下:
1. 挂载CDROM
[root@localhost mnt]# ls /dev/cdrom
/dev/cdrom
[root@localhost mnt]# mount /dev/cdrom /mnt/cdrom/

2. 安装xinetd
[root@localhost cdrom]# cd CentOS/
[root@localhost CentOS]# ls *inet*
xinetd-2.3.14-10.el5.i386.rpm
[root@localhost CentOS]# rpm -ivh xinetd-2.3.14-10.el5.i386.rpm

3. 安装tftp
[root@localhost CentOS]# ls *ftp*
ftp-0.17-35.el5.i386.rpm    tftp-0.42-3.1.el5.centos.i386.rpm
gftp-2.0.18-3.2.2.i386.rpm  tftp-server-0.42-3.1.el5.centos.i386.rpm
lftp-3.5.1-2.fc6.i386.rpm   vsftpd-2.0.5-12.el5.i386.rpm
[root@localhost CentOS]# rpm -ivh tftp-server-0.42-3.1.el5.centos.i386.rpm
[root@localhost CentOS]# rpm -ivh tftp-0.42-3.1.el5.centos.i386.rpm

4. 安装完成,查看一下
[root@localhost CentOS]# rpm -qa|grep tftp
tftp-server-0.42-3.1.el5.centos
tftp-0.42-3.1.el5.centos

5. 修改配置文件
[root@localhost CentOS]# vim /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
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
}

6. 重启xinetd,并配置tftp开机启动
[root@localhost CentOS]# service xinetd restart
[root@localhost CentOS]# setup
修改权限:
[root@localhost /]# chmod 777 /tftpboot/
重启:
[root@localhost ~]# service xinetd restart

7.测试
[root@localhost ~]# cd /tftpboot/
[root@localhost tftpboot]# ls
a.txt  ramdisk_sjx_0.7.3.gz
[root@localhost tftpboot]# vim a.txt
[root@localhost tftpboot]# cd
[root@localhost ~]# tftp 10.10.143.103
tftp> get a.txt
tftp> q
[root@localhost ~]# ls
a.txt                    install.log         remove20090915        work
[root@localhost ~]# more a.txt
aaaaaaaaaaaaaa

成功!

相关推荐