CentOS6.6下搭建vsftpd+PAM認證

1、簡介

vsftpd 是一個 UNIX 類操做系統上運行的服務器的名字,它能夠運行在諸如 Linux、BSD、Solaris、 HP-UNIX等系統上面,是一個徹底免費的、開發源代碼的ftp服務器軟件,支持不少其餘的 FTP 服務器所不支持的特徵。好比:很是高的安全性需求、帶寬限制、良好的可伸縮性、可建立虛擬用戶、支持IPv六、速率高等。[2] 數據庫

vsftpd是一款在Linux發行版中最受推崇的ftp服務器程序。特色是小巧輕快,安全易用。 vim

LINUX下實現FTP服務的軟件不少,最多見的有vsftpd,Wu-ftpd和Proftp等。Red Hat Enterprise Linux中默認安裝的是vsftpd。 安全

2、vsftpd工做方式

2.一、vsftp工做模式

vsftp分爲主動模式和被動模式: 服務器

主動模式: Server 20端口>Client session

被動模式:Server **端口----- Cilent app

w2.二、vsftp用戶類型

匿名用戶: socket

ftp 或anonymous tcp

本地用戶: ide

以真實的用戶名和密碼進行登陸,但前提條件是用戶在FTP服務器上擁有本身的賬號.用真實賬號登陸後,其登陸的目錄爲用戶本身的目錄,該目錄在系統創建賬號時系統就自動建立。 網站

虛擬用戶:

帳戶信息存放在獨立的數據庫文件或者數據庫內;

2.三、vsftp服務

Very secure FTP Daemon

官方網站;http://vsftpd.beasts.org/

服務的程序和腳本:

服務程序:/usr/sbin/vsftpd

啓動腳本:/etc.init.d/vsftpd

主配置文件:/etc/vsftpd/vsftpd.conf

2.四、vsftp主配置文件參數說明

[root@woon ~]# vim /etc/vsftpd/vsftpd.conf

# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd

# predicted this attack and has always been safe, reporting the size of the

# raw file.

# ASCII mangling is a horrible feature of the protocol.

#ascii_upload_enable=YES

#ascii_download_enable=YES

; 是否啓用ASCII方式傳送文件,通常咱們不須要這個格式。

#

# You may fully customise the login banner string:

#ftpd_banner=Welcome to blah FTP service.

; 登錄FTP服務器,所提示的歡迎信息

#

# You may specify a file of disallowed anonymous e-mail addresses. Apparently

# useful for combatting certain DoS attacks.

#deny_email_enable=YES

# (default follows)

#banned_email_file=/etc/vsftpd/banned_emails

; 如果啓用以上兩個選項,則能夠在/etc/vsftpd/banned_emails中創建黑名單。

#

# You may specify an explicit list of local users to chroot() to their home

# directory. If chroot_local_user is YES, then this list becomes a list of

# users to NOT chroot().

#chroot_local_user=YES

;設置爲yes時,用戶不能登陸到根目錄意外的目錄

#chroot_list_enable=YES

# (default follows)

#chroot_list_file=/etc/vsftpd/chroot_list

; 當登錄FTP服務器時,被列在chroot_list文件中的用戶,不能夠訪問FTP根目錄之外的目錄。

#

# You may activate the "-R" option to the builtin ls. This is disabled by

# default to avoid remote users being able to cause excessive I/O on large

# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume

# the presence of the "-R" option, so there is a strong case for enabling it.

#ls_recurse_enable=YES

; 是否可使用ls R命令

#

# When "listen" directive is enabled, vsftpd runs in standalone mode and

# listens on IPv4 sockets. This directive cannot be used in conjunction

# with the listen_ipv6 directive.

listen=YES

; 此項爲YES時,vsftpd運行於stand-alone模式下

#

# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6

# sockets, you must run two copies of vsftpd with two configuration files.

# Make sure, that one of the listen options is commented !!

#listen_ipv6=YES

; ipv6 監聽

pam_service_name=vsftpd

; 設置PAM認證服務的配置文件名稱,該文件存放在/etc/pam.d/目錄下

userlist_enable=YES

; 用戶列表中的用戶是否容許登陸ftp服務器

tcp_wrappers=YES

; tcp_wrqppers做爲主機訪問控制

此外還有許多參數未出現,列舉經常使用參數

Idle_session_timeout=300 客戶端若在300秒以內沒有任何操做,則服務器自動斷開。

max_clinet=0

最大鏈接數量(stand-alone模式下)

max_per_ip=0

每一個客戶端最大鏈接ftp服務器的鏈接數

local_max_rate=0

相關文章
相關標籤/搜索