搭建ftp服务器

xiaoxiao2021-02-28  106

为了现场监控主机或摄像头软件升级,本服务器提供文件下载服务,通过tftp文件传输协议实现软件的更新下载,tftp服务的配置说明如下。

.

TFTP是一个传输文件的简单协议基于UDP协议实现,此协议设计的时候是进行小文件传输的。因此它不具备通常的FTP许多功能,它只能从文件服务器获得或写入文件,不能列出目录。

1 安装tftp软件包

安装xinetd

 Tftp依赖xinetd,安装tftp包前,必须安装xinetd

[root@localhost Packages]# rpm –I tftp-0.32-4.i386.rpm

[root@localhost Packages]# rpm –I tcp_wrappers-libs-7.6-58.el6.i686.rpm

[root@localhost Packages]# rpm –I xinetd-2.3.11-1.9.0.i386.rpm

安装tftp包

[root@localhost Packages]# rpm –i tftp-server-0.32-4.i386.rpm

7.2 2 配置tftp

Tftp的配置文件位于/etc/xinetd.d/tfp中

# vi tftp 

# default: off 

# description: The tftp server serves filesusing the trivial file transfer \

#      protocol.  The tftp protocol isoften used to boot diskless \ 

#      workstations, download configuration files to network-aware printers, \

#      and to start the installation process for some operating systems.

service tftp

{

  disable = no  #change theparameter from yes to no, which startup xinetd will bring up tftp service

  socket_type    = dgram

  protocol       = udp

  wait          = yes

  user          = root

  server        = /usr/sbin/in.tftpd

   server_args   =-s /var/bin/tftpboot –c –v  #目录可以修改

  per_source    = 11

  cps           = 100 2

  flags          = IPv4

}

充分授权该目录(server_args所指的目录) 

# chmod 777 /var/lib/tftpboot (允许第三方可读写) 

开启69port

3.3启停tftp业务 

# service xinetd restart

#service xinetd start

TFTP是一个传输文件的简单协议基于UDP协议实现,此协议设计的时候是进行小文件传输的。因此它不具备通常的FTP许多功能,它只能从文件服务器获得或写入文件,不能列出目录。

至此tftp服务器搭建完毕。当然如果你需要进行远距离传输可以使用ftp服务器。比TFTP更安全。

4.FTP搭建              

FTP是文件传输协议。在网站上,如果你想把文件和人共享,最便捷的方式莫过于把文件上传到FTP服务器上,其他人通过FTP客户端程序来下载所需要的文件。 FTP进行文件传输需要通过端口进行。一般所需端口为: 1. 控制链路—TCP端口21。控制器端。用于发送指令给服务器以及等待服务器响应。 2. 数据链路---TCP端口20。数据传输端口。用来建立数据传输通道的。主要用来从客户向服务器发送一个文件、从服务器向客户发送一个文件、从服务器向客户发送文件或目录列表。

安装:

cd  vsftpd-3.0.3

make

makeinstall

安装完后还要把配置文件放到 /etc到

[root@localhost root]#cp vsftpd.conf/etc

启动ftp

etc/xinetd.d/vsftpd

 可能会遇到的问题      1、输入命令启动 service vsftpd start时提示:unrecognized service   解答:         很显然,你的vsftp应该有xinetd来管理。xinetd能够同时监听多个指定的端口,在接受用户请求时,它能够根据用户请求的端口的不同,启动不同的网络服务进程来处理这些用户请求。   运行:   #service xinetd restart        2、[root@hskw ~]# ftp localhost

Trying ::1...

ftp: connect to address ::1Connectionrefused

Trying 127.0.0.1...

Connected to localhost (127.0.0.1).

220 (vsFTPd 3.0.3)

Name (localhost:root): root

331 Please specify the password.

Password:******

230 Login successful.

Remote system type is UNIX.

Using binary mode to transfer files.

ftp> dir

227 Entering Passive Mode(127,0,0,1,224,160).

150 Here comes the directory listing.

转载请注明原文地址: https://www.6miu.com/read-85808.html

最新回复(0)