编译库文件vsftpd需要哪些库文件

linux下编译安装vsftpd的学习笔记
linux下编译安装vsftpd的学习笔记
vsftpd 是一个 UNIX 类操作系统上运行的服务器的名字,它可以运行在诸如 Linux, BSD, Solaris, HP-UX
以及 IRIX 上面。它支持很多其他的 FTP
服务器不支持的特征。我们先了解下FTP基本原理,以及FTP用户管理方面的基础知识。
上图FTP客户机向FTP服务器发送服务请求,FTP服务器接收与响应FTP客户机的请求,并向FTP客户机提供所需的文件传输服务。FTP客户机使用临时端口号来发送请求。为控制连接规定的熟知端口号是21,为数据连接规定的熟知端口号为20。两种连接的建立与释放的顺序:控制连接要在数据连接建立之前建立,在数据连接释放之后释放只有建立数据连接之后才能传输数据,并在数据传输过程中要保持控制连接不中断。控制连接与数据连接建立的发起者只能是FTP客户机;控制连接释放的发起者只能是FTP客户机,数据连接释放的发起者可以是FTP客户机或服务器。
上图FTP客户机向服务器请求建立控制连接,FTP客户机与服务器之间建立控制连接;FTP客户机请求登录到服务器,FTP服务器要求客户机提供用户名与密码,当FTP客户机成功登录到服务器后,FTP客户机通过控制连接向服务器发出命令,FTP服务器通过控制连接向客户机返回响应信息;当FTP客户机向服务器发出目录命令后,FTP服务器会通过控制连接返回响应信息,并通过新建立的数据连接返回目录信息。
如果用户想改变在FTP服务器的当前目录,FTP客户机通过控制连接向服务器发出改变目录命令,FTP服务器通过数据连接返回改变后的目录列表;如果用户
想下载当前目录中的某个文件,FTP客户机通过控制连接向服务器发出下载命令,FTP服务器通过数据连接将文件传输到客户机。数据连接有两种常用的工作模
式:ASCII模式和BINARY模式。其中,ASCII模式适合传输文本文件,BINARY模式适合传输二进制文件。数据连接在目录列表或文件下载后关
闭,而控制连接在程序关闭时才会关闭。
来看一下vsftpd的安装帮助
This is vsftpd, version 3.0.0
Author: Chris Evans
Website: http://vsftpd.beasts.org/
- All options are documented in the vsftpd.conf.5 manual
- See the FAQ file for solutions to frequently asked
questions.
for vsftpd news and releases.
这是vsftpd的3.00版本
作者:chris evans
联系方式:
web站点:http://vsftpd.beasts.org/
-所有选项的文档在vsftpd.conf.5这个手册页里。
-查看FAQ文件解决请求中遇到的频繁问题。
-访问获取新的vsftpd的发行版
What is this?
=============
vsftpd is an FTP server, or daemon. The "vs" stands for Very
Secure. Obviously
this is not a guarantee, but a reflection that I have written the
codebase with security in mind, and carefully designed the program
resilient to attack.
vsftpd是一个FTP服务器,或守护程序。vsftpd是非常安全的。显然这不是一个保证,但是我已经书写了反应整个代码库的安全意识,并且精心设计了这个程序被攻击后的复原。
Recent evidence shows that vsftpd is also extremely fast and
scalable. vsftpd
has achieved ~4000 concurrent users on a single machine, in a
production
environment.
最新迹象显示这个vsftpd非常快和可扩展。在生产环境vsftpd具有在单独的机器上取得4000并发用户的成绩。
vsftpd is now a proven stable solution. Of particular note, RedHat
used vsftpd
to support 15,000 concurrent users across
server pool. This extreme load was generated by the release of
RedHat 7.2 to
the world.
vsftpd now powers some of the largest and most prestigious sites on
vsftpd现在是一个成熟稳定的解决方案。详细的注释,rathat使用vsftp开启&
可支持15000个用户并发穿过他们的服务器。这种极端的负载是通过rathat7.2发行版生成的。
vsftpd现在一些功能大规模的用于互联网上那些久负盛名的网站。
Installation安装请查看INSTALL文件。
Please see the INSTALL file.
Configuration
=============
All configuration options are documented in the manual page
vsftpd.conf.5.
Various example configurations are discussed in the EXAMPLE
directory.
Frequently asked questions are tackled in the FAQ file.
所有配置选项在手册页vsftpd.conf.5.各方面的配置示例阐述都在EXAMPLE目录。常见问题的处理在FAQ文件。
This file details how to build and install / run vsftpd
这个文件详述了怎样去建立和安装/运行vsftpd
Step 1) Build vsftpd.
步骤1:建立vsftpd。
Switch to the directory created when you unpacked the vsftpd
.tar.gz file.
切换到你解压vsftpd的.tar.gz文件所建立的目录例如:
cd vsftpd-1.1.2
edit "builddefs.h" to handle compile-time settings (tcp_wrappers
编辑"builddefs.h"去处理编译时设置(tcp_wrappers建立)。
Just type "make" (and mail me to fix it if it doesn't build
This should produce you a vsftpd binary. You can test for this,
仅输入"make"(如果它不建立联系我去解决它)这将会产生一个vsftpd的二进制文件。你可以测试这个文件例如:
[chris@localhost vsftpd]$ ls -l vsftpd
-rwxrwxr-x&&& 1
chris&&&&&&
61748 Sep 27 00:26 vsftpd
Step 2) Satisfy vsftpd pre-requisites
2a) vsftpd needs the user "nobody" in the default configuration.
user in case it does not already exist. e.g.:
步骤2满足vsftpd的先决条件:
1:vsftpd需要"nobody"用户在默认的配置。添加用户的情况它早已经不存在。
[root@localhost root]# useradd nobody
useradd: user nobody exists
2b) vsftpd needs the (empty) directory /usr/share/empty in the
configuration. Add this directory in case it does not already
exist. e.g.:
2:vsftpd需要这个empty目录 /usr/share/empty
在默认配置。添加这个目录的情况是它已经不存在。例如:
[root@localhost root]# mkdir /usr/share/empty/
mkdir: cannot create directory `/usr/share/empty': File
2c) For anonymous FTP, you will need the user "ftp" to exist, and
valid home directory (which is NOT owned or writable by the user
The following commands could be used to set up the user "ftp" if
you do not
3:匿名的FTP,你将需要这个"ftp"用户存在,且具有一个有效的家目录(通过"ftp"用户不具有可写的权限).
可以使用下面的命令去设置"ftp"用户:
[root@localhost root]# mkdir /var/ftp/
[root@localhost root]# useradd -d /var/ftp ftp
如果ftp用户已经存在执行以下两个命令:
(the next two are useful to run even if the user "ftp" already
[root@localhost root]# chown root.root /var/ftp
[root@localhost root]# chmod og-w /var/ftp
Step 3) Install vsftpd config file, executable, man page,
步骤3 安装vsftpd的配置文件,执行文件 man手册 ,etc.
Running "make install" will try to copy the binary, man pages, etc.
somewhere sensible.
运行"make install" 将复制这些二进制文件,man手册,etc到莫些地方。或者你可以通过手工去复制这些文件:
Or you might want to copy these things by hand, e.g.:
cp vsftpd /usr/local/sbin/vsftpd
cp vsftpd.conf.5 /usr/local/man/man5
cp vsftpd.8 /usr/local/man/man8
"make install" doesn't copy the sample config file. It is
recommended you
make install 不能复制这个示例配置文件。它是推存你手工去复制:
cp vsftpd.conf /etc
Step 4) Smoke test (without an inetd).
步骤4 测试(没有 inetd)
vsftpd can run standalone or via an inetd (such as inetd or
xinetd). You will
typically get more control running vsftpd from an inetd. But first
we will run
it without, so we can check things are going well so far.
Edit /etc/vsftpd.conf, and add this line at the bottom:
vsftpd 可以运行在 独立的 或
绕过一个inetd(例如inetd或xinetd)。通常你需要通过inetd来控制vsftpd的运行。但是首次我们将不使它运行,所以我们可以检查事物的进展。编辑/etc/vsftpd.conf.且添加这行在下面:
listen=YES
这表明vsftpd它将不通过inetd去运行。
This tells vsftpd it will NOT be running from inetd.
Right, now let's try and run it!
立刻,现在我们尝试与运行它!
Log in as root.
以root身份登录
Make sure you are not running other FTP servers (or vsftpd will not
to use the FTP port, 21).
开始确定你没有运行其他的ftp服务(或vsftpd所需要21端口没有被使用).
Run the binary from wherever you put it, e.g.:
无论在哪里你可以运行它例如:
[root@localhost root]# /usr/local/sbin/vsftpd &
If all is well, you can now connect! e.g.:
如果所有都好,你可以立刻连接!例如:
[chris@localhost chris]$ ftp localhost
Connected to localhost (127.0.0.1).
220 (vsFTPd 1.1.1)
Name (localhost:chris): ftp
331 Please specify the password.
230 Login successful. Have fun.
Remote system type is UNIX.
Using binary mode to transfer files.
227 Entering Passive Mode (127,0,0,1,229,133)
150 Here comes the directory listing.
d--x--x--x&&& 2
0&&&&&&&&&&&
4096 Jan 14& 2002 bin
d--x--x--x&&& 2
0&&&&&&&&&&&
4096 Apr 21 20:52 etc
drwxr-xr-x&&& 2
0&&&&&&&&&&&
4096 Apr 21 20:52 lib
drwxr-sr-x&&& 2
50&&&&&&&&&&
4096 Jul 26 22:58 pub
226 Directory send OK.
Step 5) Run from an inetd of some kind (optional - standalone mode
recommended)
步骤5 从inetd的方式运行(可选-standalone模式现在推存)
You may want to run the binary from an inetd of some kind, because
give you extra features - e.g. xinetd has a lot of settings. (Note
vsftpd's inbuilt listener covers most of the more useful xinetd
settings).
你也许希望从inetd的方式运行这个二进制文件,因为这可以指定你需要的扩展功能。例如xinetd有很多的设置。(注意
vsftpd内置监听范围涵盖了大多数的xinetd的设置).
5a) If using standard "inetd", you will need to edit
/etc/inetd.conf, and add
a line such as:
如果使用标准的"inetd",你将需要去编辑/etc/inetd.conf,且添加一行例如:
ftp stream tcp nowait root /usr/sbin/tcpd
/usr/local/sbin/vsftpd
(确保删除或注释掉任何已存在的ftp服务的行,如果你没有安装"tcp-wrappers"或不希望去使用它,采取把/usr/sbin/tcpd
(Make sure to remove or comment out any existing ftp service lines.
don't have tcp_wrappers installed, or don't want to use them, take
/usr/sbin/tcpd part).
inetd将需要去重新加载它的配置文件:
inetd will need to be told to reload its config file:
kill -SIGHUP `pidof inetd`
5b) If using "xinetd", you can follow a provided example, by
looking at the
file EXAMPLE/INTERNET_SITE/README. Various other examples show how
to leverage
the more powerful xinetd features.
如果使用"xinetd",你可以尊随一个提供的示例文件,通过搜寻这个文件EXAMPLE/INTERNET_SITE/README.各种其他的示例显示了xinetd的更加强大的使用方式的特征。
Step 6) Set up PAM for local logins (optional)
建立PAM的本地登录(可选的)
If you are running vsftpd on a PAM enabled machine, you will need
/etc/pam.d/ftp file present, otherwise non-anonymous logins will
fail. [NOTE -
if you have an older version of PAM, that file might be
/etc/pam.conf]
如果在运行的vsftpd机器开启了PAM,你需要提出一个/etc/pam.d/ftp文件,否则non-anonymous登录将失败。[注释-如果你有一个PAM的旧版本,这个文件可能是/etc/pam.conf]
For a standard setup, you can just copy a provided example
cp RedHat/vsftpd.pam /etc/pam.d/ftp
一个标准的设置,你可以仅复制一个提供的示例文件:
Step 7) Customize your configuration
定制你的配置
As well as the above three pre-requisites, you are recommended to
config file. The default location for the config file is
/etc/vsftpd.conf.
There is a sample vsftpd.conf in the distribution tarball. You
probably want
to copy that to /etc/vsftpd.conf as a basis for modification,
上述三种先决条件,建议你去安装一个配置文件。配置文件默认的位置在/etc/vsftpd.conf.
这是一个示例文件vsftpd.conf在发行版的tar包。你可能希望去复制他到/etc/vsftpd.conf作为改正的基础。例如:
cp vsftpd.conf /etc
The default configuration allows neither local user logins nor
uploads. You may wish to change these defaults.
默认的配置即允许本地用户的登录又不允许匿名用户的上传。你可能希望去更改这些默认设置。
Other notes
===========
任何现在,功能完善平台应该工作正常!最近版本的平台列表如下,已及常用的旧版本号。应该工作正常。
Tested platforms (well, it builds)
- Any modern, well featured platform should work fine! Recent
versions of
the platforms listed below, and often older ones, should work
- Fedora Core
- RedHat Linux
- RedHat Enterprise Linux
- Solaris / GNU tools (Solaris 8 or newer)
- SuSE Linux
- Debian Linux
- HP-UX / GNU tools
- IRIX / GNU tools
- AIX / GNU tools
- Mac OS X ( older versions have setgroups() problem. 10.3.4
reported OK)
下一篇记录了我学习vsftpd的配置时的一些学习笔记本人翻译的不好大家谅解
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。4114人阅读
linux 系统配置(3)

首先,下载vsftpd-3.0.2源码包.
详细的安装过程如下:
[root@localhost vsftpd-3.0.2]# tar zxvf vsftpd-3.0.2.tar.gz
[root@localhost vsftpd-3.0.2]# cd vsftpd-3.0.2
[root@localhost vsftpd-3.0.2]# make
[root@localhost vsftpd-3.0.2]# ls -l vsftpd
-rwxr-xr-x. 1 root root 月 31 15:56 vsftpd
如果系统中没有nobody的用户,请增加nobody用户
[root@localhost vsftpd-3.0.2]# useradd nobody
useradd: user 'nobody' already exists
如果系统中没有/usr/share/empty/目录,请增加/usr/share/empty/目录
[root@localhost vsftpd-3.0.2]# mkdir /usr/share/empty/
mkdir: 无法创建目录&/usr/share/empty/&: 文件已存在
建立ftp目录,并建立ftp用户
[root@localhost vsftpd-3.0.2]# ll /webserver/ftp/
ls: 无法访问/webserver/ftp/: 没有那个文件或目录
[root@localhost vsftpd-3.0.2]# mkdir /webserver/ftp/
[root@localhost vsftpd-3.0.2]# useradd -d /var/ftp ftp
useradd: user 'ftp' already exists
[root@localhost vsftpd-3.0.2]# chown root.root /webserver/ftp
[root@localhost vsftpd-3.0.2]# chmod og-w /webserver/ftp
然后进行编译安装:
[root@localhost vsftpd-3.0.2]# make install
if [ -x /usr/local/sbin ]; then \
&&&&&&&&&&&&&&& install -m 755 vsftpd /usr/local/sbin/ \
&&&&&&& else \
&&&&&&&&&&&&&&& install -m 755 vsftpd /usr/sbin/ fi
if [ -x /usr/local/man ]; then \
&&&&&&&&&&&&&&& install -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \
&&&&&&&&&&&&&&& install -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \
&&&&&&& elif [ -x /usr/share/man ]; then \
&&&&&&&&&&&&&&& install -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \
&&&&&&&&&&&&&&& install -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \
&&&&&&& else \
&&&&&&&&&&&&&&& install -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \
&&&&&&&&&&&&&&& install -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi
install: 无法创建普通文件&/usr/local/man/man8/vsftpd.8&: 没有那个文件或目录
install: 无法创建普通文件&/usr/local/man/man5/vsftpd.conf.5&: 没有那个文件或目录
make: *** [install] 错误 1
发现有两个错误,我们需要修改Makefile文件,
[root@localhost vsftpd-3.0.2]# vi Makefile
将install的部分替换为以下内容:
if [ -x /usr/local/sbin ]; then \
$(INSTALL) -m 755 vsftpd /usr/local/sbin/ \
$(INSTALL) -m 755 vsftpd /usr/sbin/ fi
if [ -x /usr/share/man ]; then \
$(INSTALL) -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \
$(INSTALL) -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \
elif [ -x /usr/local/man ]; then \
$(INSTALL) -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \
$(INSTALL) -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \
$(INSTALL) -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \
$(INSTALL) -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi
if [ -x /etc/xinetd.d ]; then \
$(INSTALL) -m 644 xinetd.d/vsftpd /etc/xinetd.d/ fi
保存之后,重新运行make install,
[root@localhost vsftpd-3.0.2]# make install
if [ -x /usr/local/sbin ]; then \
&&&&&&&&&&&&&&& install -m 755 vsftpd /usr/local/sbin/ \
&&&&&&& else \
&&&&&&&&&&&&&&& install -m 755 vsftpd /usr/sbin/ fi
if [ -x /usr/share/man ]; then \
&&&&&&&&&&&&&&& install -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \
&&&&&&&&&&&&&&& install -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \
&&&&&&& elif [ -x /usr/local/man ]; then \
&&&&&&&&&&&&&&& install -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \
&&&&&&&&&&&&&&& install -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \
&&&&&&& else \
&&&&&&&&&&&&&&& install -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \
&&&&&&&&&&&&&&& install -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi
if [ -x /etc/xinetd.d ]; then \
&&&&&&&&&&&&&&& install -m 644 xinetd.d/vsftpd /etc/xinetd.d/ fi
成功啦!复制配置文件到/etc目录中。
[root@localhost vsftpd-3.0.2]# cp vsftpd.conf /etc/
复制pam验证文件,允许本地用户登陆vsftpd。
[root@localhost vsftpd-3.0.2]# cp RedHat/vsftpd.pam /etc/pam.d/vsftpd
下面我们进行vsftpd的配置
允许本地用户登陆
[root@localhost vsftpd-3.0.2]# vi /etc/vsftpd.conf
我们需要取消vsftpd.conf以下三行的注释:
local_enable=YES
write_enable=YES
local_umask=022
locat_root=/webserver/ftp
#ftp登陆之后的目录路径
启动并测试vsftpd
[root@localhost vsftpd-3.0.2]# /usr/local/sbin/vsftpd &
在客户端使用ftp工具测试本地用户登陆即可。
原文出自【风信网】,转载请保留原文链接:
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:71952次
排名:千里之外
原创:14篇
转载:32篇
(3)(1)(2)(1)(2)(2)(7)(6)(1)(3)(1)(1)(1)(1)(8)(2)(1)(5)守护每一天 的BLOG
用户名:守护每一天
文章数:67
访问量:38026
注册日期:
阅读量:5863
阅读量:12276
阅读量:405791
阅读量:1094336
51CTO推荐博文
&&&&&&&&&&&&&& Linux vsftpd编译安装和配置允许本地用户登录FTP
&&&& 是一款在发行版中最受推崇的FTP服务器程序。特点是小巧轻快,安全易用。下面我们一步一步介绍如何编译安装vsftpd和配置。
1、下载vsftpd源码
wget /downloads/vsftpd-2.3.4.tar.gz
2、编译vsftpd源码
64位的系统编译之前先要执行cp /lib64/libcap.so.1 /lib/libcap.so.1命令:
tar xzvf vsftpd-2.3.4.tar.gz
cd vsftpd-2.3.4
make install
3、配置vsftpd
cp vsftpd.conf /etc
cp RedHat/vsftpd.pam /etc/pam.d/ftp
sed i 's/anonymous_enable/#anonymous_enable=YES/g' /etc/vsftpd.conf
sed i 's/#local_enable=YES/local_enable=YES/g' /etc/vsftpd.conf
sed i 's/#write_enable=YES/write_enable=YES/g' /etc/vsftpd.conf
sed i 's/#local_umask=022/local_umask=022/g' /etc/vsftpd.conf
sed i 's/#chroot_local_user=YES/chroot_local_user=YES/g' /etc/vsftpd.conf
4、启动vsftpd并设置开机启动
/usr/local/sbin/vsftpd &
sed -i '$a\/usr/local/sbin/vsftpd &' /etc/rc.d/rc.local
5、添加FTP用户(用户名:ftpuser ftp根目录/home/wwwroot/ftpuser)
useradd -d /home/wwwroot/ftpuser -g ftp -s /sbin/nologin ftpuser
本文出自 “” 博客,请务必保留此出处
了这篇文章
类别:┆阅读(0)┆评论(0)

我要回帖

更多关于 编译好的vsftpd 的文章

 

随机推荐