Linux 之 FTP服务器搭建
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服务器搭建的更多相关文章
- 《Linux下FTP服务器搭建及FTP使用》
.LOGAndy:mxtd114 <Linux下FTP服务器搭建> 0.root登录 1.安装ftp # yum -y install ftp 2.安装vsftpd # yum -y in ...
- Linux中ftp服务器搭建
一.FTP工作原理 (1)FTP使用端口 [root@localhost ~]# cat /etc/services | grep ftp ftp-data 20/tcp #数据链路:端口20 ftp ...
- linux下FTP服务器搭建教程1
你买了个主机就像是买了块地皮,搭建FTP就像是盖房子,我在地皮上建房子,然后创建的用户就像是钥匙,我给谁钥匙(权限),谁就可以到我家去玩,去放东西,拿东西. 虽然我们买不起现实的房子,但是我们可以买互 ...
- linux上FTP服务器搭建
一.启动vsftpd服务 1. 启动VSFTP服务器 A. cenos下运行:yum install vsftpd B. 登录Linux主机后,运行命令:"service vsftpd st ...
- 一起来学linux:FTP服务器搭建
首先安装vsftpd: apt install vsftpd有下面几个重要的配置文件:1 /etc/vsftpd.conf. 这个是vsftpd的配置文件.通过“参数=设置值”的方式来设置的. 2 / ...
- linux centos ftp服务器搭建
原文参考 步骤一:构建vsftpd服务器 1)使用yum安装vsftpd软件包yum -y install vsftpdrpm -q vsftpd #确认安装成功,显示vsftpd对应版本 vsftp ...
- linux下ftp服务器搭建
1.yum install vsftpd 使用yum安装ftp 2.创建并授权ftp文件目录 mkdir -P /ftp/ftpadmin chmod -R 777 /ftp/ftp ...
- Linux CentOS 6.5 下 vsftpd ftp服务器搭建
Linux CentOS 6.5 下 vsftpd ftp服务器搭建 by:授客 QQ:1033553122 操作系统环境:CentOS 6.5-x86_64 下载地址:http://www.ce ...
- Linux之匿名FTP服务器搭建
FTP(File Transfer Protocol)是在服务器与客户端进行文件传输的一种传输协议.本次介绍的是vsftpd的软件体验ftp服务. FTP服务器默认情况下依据用户登录情况分为三种不同的 ...
随机推荐
- 03IO端口寻址和访问控制方式
1. I/O端口和寻址 CPU 为了访问 I/O 接口控制器或者控制卡上的数据和状态信息,需要首先指定他们的地址.这种地址就称为I/O端口地址或简称端口.通常一个 I/O 控制器包含访问数据的数据端口 ...
- paper:synthesizable finit state machine design techniques using the new systemverilog 3.0 enhancements之output encoded style with registered outputs(Good style)
把输出跟状态编码结合起来,即使可以省面积又是寄存器输出.但是没有讲解如何实现这种高效的编码.
- Linux 常用命令(三)
一.less --分页查看文件:方面查阅(编辑)大文件 说明:支持方向键盘和鼠标向上向下浏览 -N 显示行号 二.head --output the first part of files 默认显示 ...
- mysql按指定顺序排序
select id,name from htms_center_freight_users where id in(114,112,91,223,134) order by find_in_set(i ...
- 第3-5课 填充左侧菜单/品牌的添加 Thinkphp5商城第四季
目录 左侧菜单的填充 品牌的添加 form标签里要加上method="post" enctype="multipart/form-data" form标签里如果 ...
- Python9-网络编程-day30
# 由于不同机器上的程序要通信,才产生了网络# server# client# 端口 找到的程序# 在计算机上,每一个需要网络通信的程序,都会开一个端口# 在同一时间只会有一个程序占用一个端口# 不可 ...
- ubuntu12.04ppa安装emacs24
ppa地址:https://launchpad.net/~cassou/+archive/emacs 因为debian版本的emacs-snapshot维护者停止更新,所有ubuntu上的也停止了. ...
- HDU 5489 Removed Interval DP 树状数组
题意: 给一个长度为\(N\)的序列,要删除一段长为\(L\)的连续子序列,问所能得到的最长的\(LIS\)的长度. 分析: 设\(f(i)\)表示以\(a_i\)结尾的\(LIS\)的长度,设\(g ...
- Vue简单了解
目录 1. 前端概览 2. 现代前端开发方式 3. MVVM开发核心 4. Vue核心 5. Vue优点 6. Vue难点 7. Vue与非Vue项目结合 8. Vue调试 9. Vue与SEO 今天 ...
- python - log日志
# -*- coding:utf-8 -*- ''' @project: jiaxy @author: Jimmy @file: study_logging.py @ide: PyCharm Comm ...