FTP服务器搭建


参考教程:【千峰教育


1、关闭防火墙:

  service iptables stop

2、关闭Selinux
  setenforce 0

3、安装所需要依赖及编译工具
  yum install -y gcc openssl-devel perl

4、下载pure-ftpd
  (1)搜索pure-ftpd,一般是第一个,打开链接:https://www.pureftpd.org/project/pure-ftpd。
  (2)点击页面右侧列表的的【Download】:https://www.pureftpd.org/project/pure-ftpd/download。
  (3)点击【Primary HTTP download site】:http://download.pureftpd.org/pub/pure-ftpd/。
  (4)在列表中点击发行版【releases/】:https://download.pureftpd.org/pub/pure-ftpd/releases/。
  (5)选择其中一个版本,例如【pure-ftpd-1.0.47.tar.gz】,复制下载链接。
  (6)在Linux中执行下载命令:
    curl -O https://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.47.tar.gz

5、解压
  tar -zxvf pure-ftpd-1.0.47.tar.gz

6、进行配置
  cd pure-ftpd-1.0.47
  ./configure --prefix=/usr/local/pureftpd --without-inetd --with-altlog --with-puredb --with-throttling -with-tls

7、编译和安装
  make && make install

8、修改配置文件
  注意:这里好像区分版本,不同版本不太一样:
  (1)如果下载的目录里【有configuration-file目录】:
    mkdir -p /usr/local/pureftpd/etc
    cd ./configuration-file/
    cp pure-ftpd.conf /usr/local/pureftp/etc/
  (2)如果下载的目录里【没有configuration-file目录】:
    可能配置文件已经存在于指定的目录下了。
   

  修改:/usr/local/pureftpd/etc/pure-ftpd.conf
    如下:
    PureDB /usr/local/pureftpd/etc/pureftpd.pdb
    PIDFile /usr/local/pureftpd/var/run/pure-ftpd.pid

9、启动服务
  注意:这里好像区分版本,不同版本不太一样:
  (1)如果下载的目录里【有configuration-file目录】:
    这里目录里会有pure-config.pl控制文件:
    cp pure-config.pl /usr/local/pureftpd/sbin/
    chmod 755 pure-config.pl
    然后启动:
      cd /usr/local/pureftpd
      ./sbin/pure-config.pl ./etc/pure-ftpd.conf
  (2)如果下载的目录里【没有configuration-file目录】:
    启动:
      cd /usr/local/pureftpd
      ./sbin/pure-ftpd ./etc/pure-ftpd.conf
      或者
      /usr/local/pureftpd/sbin/pure-ftpd /usr/local/pureftpd/etc/pure-ftpd.conf

10、检查是否启动:
  使用netstat命令:
  结果看到如下信息,21号端口,pure-ftpd,说明启动了。
  tcp   0 0 0.0.0.0:21   0.0.0.0:*   LIST   EN   22755/pure-ftpd

11、添加管理用户:
  useradd ftp-user    #在系统中的添加一个用户ftp-user
  mkdir -p /var/www/html/
  chown -R ftp-user:ftp-user /var/www/html/
  ./bin/pure-pw useradd zhangsan -u ftp-user -d /var/www/html
  说明:
    zhangsan 是使用ftp登录时的用户名
    -u:指系统中存在的用户ftp-user
    -d:指定访问的目录
    ./bin/pure-pw命令在/usr/local/pureftpd/下。

12、创建虚拟的用户数据库

  cd /usr/local/pureftpd/
  ./bin/pure-pw mkdb
  查看:
  ./bin/pure-pw list

13、测试:
  通过ftp工具(FileZilla)测试。
  主机:填写虚拟机地址。
  端口:21。
  协议:FTP-文件传输协议。
  加密:只使用普通FTP(不安全)
  登录类型:询问密码。
  用户:用户名,即示例中设置的zhangsan


扩展知识:

  ctrl+u 清空当前输入
  ctrl+l 清空屏幕

  

  解压pure-ftpd-1.0.47.tar.gz时提示:

    gzip: stdin: unexpected end of file
    tar: 归档文件中异常的 EOF
    tar: 归档文件中异常的 EOF
    tar: Error is not recoverable: exiting now
  原因:
    源码包在下载过程中被破坏或者不完整所致。
    可以看到,下载后的大小和开始下载时显示的总大小是不一样的。
  解决方法:
    重新下载。
    如果服务器的网速较慢,或下载后还是不完整的文件,可以选择在windows上下载后,上传到服务器行。
    本地下载curl软件后,在cmd命令行,执行上面的而下载命令:
    curl -O https://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.47.tar.gz
    然后上传。

  ./configure的那个配置项有时间要具体了解一下,这里不做说明了。


Linux 之 FTP服务器搭建的更多相关文章

  1. 《Linux下FTP服务器搭建及FTP使用》

    .LOGAndy:mxtd114 <Linux下FTP服务器搭建> 0.root登录 1.安装ftp # yum -y install ftp 2.安装vsftpd # yum -y in ...

  2. Linux中ftp服务器搭建

    一.FTP工作原理 (1)FTP使用端口 [root@localhost ~]# cat /etc/services | grep ftp ftp-data 20/tcp #数据链路:端口20 ftp ...

  3. linux下FTP服务器搭建教程1

    你买了个主机就像是买了块地皮,搭建FTP就像是盖房子,我在地皮上建房子,然后创建的用户就像是钥匙,我给谁钥匙(权限),谁就可以到我家去玩,去放东西,拿东西. 虽然我们买不起现实的房子,但是我们可以买互 ...

  4. linux上FTP服务器搭建

    一.启动vsftpd服务 1. 启动VSFTP服务器 A. cenos下运行:yum install vsftpd B. 登录Linux主机后,运行命令:"service vsftpd st ...

  5. 一起来学linux:FTP服务器搭建

    首先安装vsftpd: apt install vsftpd有下面几个重要的配置文件:1 /etc/vsftpd.conf. 这个是vsftpd的配置文件.通过“参数=设置值”的方式来设置的. 2 / ...

  6. linux centos ftp服务器搭建

    原文参考 步骤一:构建vsftpd服务器 1)使用yum安装vsftpd软件包yum -y install vsftpdrpm -q vsftpd #确认安装成功,显示vsftpd对应版本 vsftp ...

  7. linux下ftp服务器搭建

    1.yum install vsftpd  使用yum安装ftp 2.创建并授权ftp文件目录   mkdir -P /ftp/ftpadmin       chmod -R 777 /ftp/ftp ...

  8. Linux CentOS 6.5 下 vsftpd ftp服务器搭建

    Linux CentOS 6.5 下 vsftpd ftp服务器搭建 by:授客 QQ:1033553122   操作系统环境:CentOS 6.5-x86_64 下载地址:http://www.ce ...

  9. Linux之匿名FTP服务器搭建

    FTP(File Transfer Protocol)是在服务器与客户端进行文件传输的一种传输协议.本次介绍的是vsftpd的软件体验ftp服务. FTP服务器默认情况下依据用户登录情况分为三种不同的 ...

随机推荐

  1. Voyager的数据库操作与Bread Builder,解决国内打开网速超级慢的问题

    Products表的创建: Bread Builder 伟大的XX封了谷哥,所以有关网站实在是打不开,正准备放弃的时候,突然发现问题了,对就是这个网站ajax.googleapis.com,由于调用的 ...

  2. Springboot @Autowired 无法注入问题

    特别提醒:一定要注意文件结构 WebappApplication 一定要在包的最外层,否则Spring无法对所有的类进行托管,会造成@Autowired 无法注入. 1. 添加工具类获取在 Sprin ...

  3. Optimization & Map

  4. w3resource_MySQL练习:Subquery

    w3resource_MySQL练习题:Subquery 1. Write a query to find the name (first_name, last_name) and the salar ...

  5. leetcode-25-exercise_string&array

    14. Longest Common Prefix Write a function to find the longest common prefix string amongst an array ...

  6. Android内核编译步骤

    android_4.0.4_tq210$ source build/envsetup.shandroid_4.0.4_tq210$ lunch 5/android_4.0.4_tq210$ make ...

  7. LeetCode (160) Intersection of Two Linked Lists

    题目 Write a program to find the node at which the intersection of two singly linked lists begins. For ...

  8. Linux网络文件系统NFS详解

    什么是文件系统,NFS文件系统又是什么? 简单的说,文件系统就是通过软件对磁盘上的数据进行组织和管理的一种机制,对其的一种封装或透视. 你女朋友拍了美美的暧昧照片,放一个文件夹里发送给了A服务器,当你 ...

  9. debian软raid

    http://www.linuxidc.com/Linux/2013-06/86487.htm  

  10. &与&&有什么区别?

    一.简要说明 按位与:a&b是把a和b都转换成二进制数然后再进行与的运算: 逻辑与:a&&b就是当且仅当两个操作数均为 true时,其结果才为 true:只要有一个为零,a&a ...