编程开源技术交流,分享技术与知识

网站首页 > 开源技术 正文

CentOS7搭建tftp server(Centos7搭建ftp服务器)

wxchong 2024-11-06 12:43:07 开源技术 34 ℃ 0 评论

1.安装TFTP服务:

#yum install tftp-server

?2.安装Xinetd服务,TFTP服务是通过xintd运行的,所以需要安装Xinetd

#yum install xinetd

?3.配置编辑vim /etc/xinetd.d/tftp文件,?

修改下表中的两个地方:server_args为你自己的TFTPBOOT目录,即FTP文件的根目录;缺省情况下,是禁用TFTP服务的,所以把disable的值改为no。

# 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 /home/tftpboot? -c

disable = no?

per_source = 11

cps = 100 2

flags = IPv4}

4.设置TFTPBOOT的访问权限: #chmod 777 /home/tftpboot

5.激活Xinetd和Xinetd

#chkconfig tftp on

#chkconfig xinetd on

# service xinetd start

6.测试

#tftp 192.168.65.200

tftp> ?put

tftp> ?get

tftp> ?q

可能出现的问题

1.出现TFTP error: 'Permission denied' (0)的解决

这个是由于selinux机制引起的不是文件夹的权限问题。

所以vi /etc/sysconfig/selinux 修改为:SELINUX=permissive

如果不想重启系统,执行:

sudo setenforce 0

2.如果上传文件出现:tftp: server error: (1) File not found

解决方法:在/etc/xinetd.d/tftp文件server_args的-s选项后面添加-c

执行service xinetd restart成功。

3.本地测试tftp出现command not found,可能是安装有问题,重新安装一般都会解决。

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表