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. BZOJ 2002 弹飞绵羊(分块)

    题目:弹飞绵羊 这道题,据说是lct裸题,但是lct那么高级的数据结构,我并不会,所以采取了学长讲过的分块做法,我们对序列分块,可以定义两个数组,其中一个表示从当前位置跳出当前块需要多少步,另一个数组 ...

  2. CF #552 div3

    A - Restoring Three Numbers CodeForces - 1154A Polycarp has guessed three positive integers aa, bb a ...

  3. salt常用模块

    salt 常用命令整理     转载:https://www.cnblogs.com/aslongas/p/6964890.html salt 常用命令整理 ***********模块******** ...

  4. 【netbeans】netbeans utf-8编码

    首先,在你的netbeans的安装文件夹里面找到etc这个文件夹,打开,在里面找到netbeans.conf这个文件,打开,找到这一句netbeans_default_options="-J ...

  5. HMAC(Hash-based Message Authentication Code)实现原理

    1.HMAC 概念 HMAC(Hash-based Message Authentication Code)基于 hash 的消息验证码,是 安全通信中必要的组成部件. 主要是 防止消息被篡改,和对称 ...

  6. Python9-进程池-day38

    复习 # 信号量 from multiprocessing import Semaphore # 用锁的原理实现的,内置了一个计数器 # 在同一个事件,只能有指定数量的进程执行某一段被控制住的代码 # ...

  7. ubuntu gcc的下载链接,比较快的。

    http://mirrors.163.com/ubuntu-releases/ http://xhmikosr.1f0.de/tools/msys/

  8. POJ:1753-Flip Game(二进制+bfs)

    题目链接:http://poj.org/problem?id=1753 Flip Game Time Limit: 1000MS Memory Limit: 65536K Description Fl ...

  9. 卸载firefox多余的搜索引擎

    火狐默认了几个搜索引擎,百度,bing,yahoo等.搜一些技术方面的东西的时候,google返回的结果比这些要准确有用.所以想卸载掉那些不用的. 具体操作: 点击搜索栏,左侧搜索引擎图票右下角的倒三 ...

  10. 2049: [Sdoi2008]Cave 洞穴勘测(LCT)

    2049: [Sdoi2008]Cave 洞穴勘测 Time Limit: 10 Sec  Memory Limit: 259 MBSubmit: 9962  Solved: 4824[Submit] ...