偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

CentOS下配置vsftpd

運(yùn)維 系統(tǒng)運(yùn)維
CentOS下配置vsftpd還是比較常用的,這里所講解介紹centos vsftpd的安裝。CentOS Linux與RHEL產(chǎn)品有著嚴(yán)格的版本對(duì)應(yīng)關(guān)系。那么該如何在CentOS下配置vsftpd?本章將一一簡(jiǎn)述,CentOS下配置vsftpd

  1、通過YUM安裝必需的vsftpd, pam, pam-devel;

  2、通過編譯安裝必需的pam_mysql(下面附件里);

  3、修改默認(rèn)vsftpd配置文件 (/etc/vsftpd/vsftpd.conf)以及添加ftp用戶的權(quán)限配置文件(/etc/vsftpd/vconf/);

  4、添加虛擬系統(tǒng)用戶,及其ftp用戶登錄認(rèn)證數(shù)據(jù)庫(kù);

  5、修改vsftpd默認(rèn)的pam配置文件 (/etc/pam.d/vsftpd);

  6、添加ftp端口到防火墻,重啟vsftpd服務(wù),測(cè)試ftp虛擬用戶登錄。

  1)

  1.   [simonsun@magic ~]$ sudo yum install vsftpd pam pam-devel  
  2.  

  目前的版本為

  vsftpd - 2.0.5-12.el5, pam - 0.99.6.2-3.27.el5, pam-devel - 0.99.6.2-3.27.el5。

  2)

  1.   [simonsun@magic ~]$ wget http://prdownloads.sourceforge.net/pam-mysql/pam_mysql-0.7RC1.tar.gz  
  2.  
  3.   [simonsun@magic ~]$ tar zxvf pam_mysql-0.7RC1.tar.gz  
  4.  
  5.   [simonsun@magic ~]$ ls pam_mysql-0.7RC1  
  6.  
  7.   acinclude.m4 config.guess configure CREDITS ltmain.sh missing pam_mysql.c pkg.m4  
  8.  
  9.   aclocal.m4 config.h.in configure.in INSTALL Makefile.am mkinstalldirs pam_mysql.spec README  
  10.  
  11.   ChangeLog config.sub COPYING install-sh Makefile.in NEWS pam_mysql.spec.in stamp-h.in  
  12.  
  13.   [simonsun@magic ~]$ vim pam_mysql-0.7RC1/configure  
  14.  

  #修改configure中的一個(gè)bug,將下面的一段修改,加上#include ,原來(lái)沒有此引用。

  =================================

  1.   #include   
  2.  
  3.   #include   
  4.  
  5.   int  
  6.  
  7.   main ()  
  8.  
  9.   {  
  10.  
  11.   md5_calc(0, 0, 0);  
  12.  
  13.   ;  
  14.  
  15.   return 0;  
  16.  
  17.   }  
  18.  

  =================================

  1.   [simonsun@magic ~]$ cd pam_mysql-0.7RC1  
  2.  
  3.   [simonsun@magic pam_mysql-0.7RC1]$ ./configure  
  4.  
  5.   [simonsun@magic pam_mysql-0.7RC1]$ make  
  6.  
  7.   [simonsun@magic pam_mysql-0.7RC1]$ sudo make install  
  8.  
  9.   [simonsun@magic pam_mysql-0.7RC1]$ sudo cp /usr/lib/security/pam_mysql.* /lib/security/  
  10.  

  3)

 

  1.   [simonsun@magic ~]$ sudo vim /etc/vsftpd/vsftpd.conf  
  2.  

  ======================================

  1.   anonymous_enable=NO 
  2.  
  3.   local_enable=YES 
  4.  
  5.   write_enable=YES 
  6.  
  7.   local_umask=022 
  8.  
  9.   #anon_upload_enable=YES 
  10.  
  11.   #anon_mkdir_write_enable=YES 
  12.  
  13.   dirmessage_enable=YES 
  14.  
  15.   xferlog_enable=YES 
  16.  
  17.   connect_from_port_20=YES 
  18.  
  19.   #chown_uploads=YES 
  20.  
  21.   #chown_username=whoever 
  22.  
  23.   xferlog_file=/var/log/vsftpd.log  
  24.  
  25.   xferlog_std_format=YES 
  26.  
  27.   #idle_session_timeout=600 
  28.  
  29.   #data_connection_timeout=120 
  30.  
  31.   #nopriv_user=ftpsecure 
  32.  
  33.   #async_abor_enable=YES 
  34.  
  35.   #ascii_upload_enable=YES 
  36.  
  37.   #ascii_download_enable=YES 
  38.  
  39.   ftpd_banner=Welcome to Magic Linux FTP service.  
  40.  
  41.   #deny_email_enable=YES 
  42.  
  43.   # (default follows)  
  44.  
  45.   #banned_email_file=/etc/vsftpd/banned_emails  
  46.  
  47.   chroot_local_user=YES 
  48.  
  49.   #chroot_list_enable=YES 
  50.  
  51.   # (default follows)  
  52.  
  53.   #chroot_list_file=/etc/vsftpd/chroot_list  
  54.  
  55.   #ls_recurse_enable=YES 
  56.  
  57.   listen=YES 
  58.  
  59.   listen_port=21 
  60.  
  61.   #listen_ipv6=YES 
  62.  

  #下面是添加的:

 

  1.   guest_enable=YES 
  2.  
  3.   guest_username=vvsftpd #虛擬系統(tǒng)用戶,在步驟4)中添加該用戶到系統(tǒng)用戶中。  
  4.  
  5.   user_config_dir=/etc/vsftpd/vconf/ #登錄ftp的虛擬用戶的權(quán)限配置文件。  
  6.  
  7.   pam_service_name=vsftpd 
  8.  
  9.   userlist_enable=YES 
  10.  
  11.   tcp_wrappers=YES 
  12.  

  ======================================

  1.   [simonsun@magic ~]$ sudo mkdir /etc/vsftpd/vconf/  
  2.  
  3.   [simonsun@magic ~]$ sudo vim /etc/vsftpd/vconf/myftp  
  4.  

  ======================================

  1.   write_enable=YES 
  2.  
  3.   anon_upload_enable=YES 
  4.  
  5.   anon_mkdir_write_enable=YES 
  6.  
  7.   anon_world_readable_only=NO 
  8.  

  ======================================

  4)

  1.   [simonsun@magic ~]$ sudo /usr/sbin/useradd -d /home/vvsftpd -s /sbin/nologin vvsftpd  
  2.  
  3.   [simonsun@magic ~]$ mysql -u root -p  
  4.  

  #執(zhí)行如下語(yǔ)句,為虛擬系統(tǒng)用戶vvsftpd創(chuàng)建虛擬用戶(如myftp)登錄ftp時(shí)的認(rèn)證數(shù)據(jù)庫(kù)vsftpd

  1.   ======================================  
  2.  
  3.   create database vsftpd;  
  4.  
  5.   use vsftpd;  
  6.  
  7.   create table user(name char(20) binary,passwd char(20) binary);  
  8.  
  9.   insert into user values ('myftp',ENCRYPT('ptfym'));  
  10.  
  11.   grant select on vsftpd.user to vvsftpd@localhost identified by 'PaSsWoRd';  
  12.  
  13.   flush privileges;  
  14.  
  15.   ======================================  
  16.  

  5)

  1.   [simonsun@magic ~]$ sudo vim /etc/pam.d/vsftpd  
  2.  

  修改成如下

  1.   ======================================  
  2.  
  3.   #%PAM-1.0  
  4.  
  5.   session optional pam_keyinit.so force revoke  
  6.  
  7.   auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers nerr=succeed 
  8.  
  9.   #auth required pam_shells.so  
  10.  
  11.   auth required /lib/security/pam_mysql.so user=vvsftpd passwd=PaSsWoRd host=localhost db=vsftpd table=user usercolumn=name passwdpasswdcolumn=passwd crypt=1 
  12.  
  13.   account required /lib/security/pam_mysql.so user=vvsftpd passwd=PaSsWoRd host=localhost db=vsftpd table=user usercolumn=name passwdpasswdcolumn=passwd crypt=1 
  14.  
  15.   #auth include system-auth  
  16.  
  17.   #account include system-auth  
  18.  
  19.   session include system-auth  
  20.  
  21.   session required pam_loginuid.so  
  22.  
  23.   ======================================  
  24.  

  6)

  1.   [simonsun@magic ~]$ sudo /sbin/iptables -I INPUT -p tcp --dport 20 -j ACCEPT  
  2.  
  3.   [simonsun@magic ~]$ sudo /sbin/iptables -I INPUT -p tcp --dport 21 -j ACCEPT  
  4.  
  5.   [simonsun@magic ~]$ sudo /etc/rc.d/init.d/iptables save  
  6.  
  7.   [simonsun@magic ~]$ sudo /etc/rc.d/init.d/iptables restart  
  8.  

  清除防火墻規(guī)則: [確定]

  把 chains 設(shè)置為 ACCEPT 策略:filter nat [確定]

  正在卸載 Iiptables 模塊: [確定]

  應(yīng)用 iptables 防火墻規(guī)則: [確定]

  載入額外 iptables 模塊:ip_conntrack_netbios_ns [確定]

  1.   [simonsun@magic ~]$ sudo /etc/rc.d/init.d/vsftpd restart  
  2.  

  關(guān)閉 vsftpd: [確定]

  為 vsftpd 啟動(dòng) vsftpd: [確定]

  1.   [simonsun@magic ~]$ ftp shellfisher.3322.org  
  2.  
  3.   Connected to shellfisher.3322.org.  
  4.  
  5.   220 Welcome to Magic Linux FTP service.  
  6.  
  7.   530 Please login with USER and PASS.  
  8.  
  9.   530 Please login with USER and PASS.  
  10.  
  11.   KERBEROS_V4 rejected as an authentication type  
  12.  
  13.   Name (shellfisher.3322.org:simonsun): myftp  
  14.  
  15.   331 Please specify the password.  
  16.  
  17.   Password:  
  18.  
  19.   230 Login successful.  
  20.  
  21.   Remote system type is UNIX.  
  22.  
  23.   Using binary mode to transfer files.  
  24.  
  25.   ftp> ls  
  26.  
  27.   227 Entering Passive Mode (221,215,250,110,86,88)  
  28.  
  29.   150 Here comes the directory listing.  
  30.  
  31.   226 Directory send OK.  
  32.  
  33.   ftp> mkdir testftp  
  34.  
  35.   257 "/testftp" created  
  36.  
  37.   ftp> ls  
  38.  
  39.   227 Entering Passive Mode (221,215,250,110,43,155)  
  40.  
  41.   150 Here comes the directory listing.  
  42.  
  43.   drwx------ 2 507 509 4096 Mar 24 08:32 testftp  
  44.  
  45.   226 Directory send OK.  
  46.  
  47.   ftp> quit  
  48.  
  49.   221 Goodbye.  
  50.  
  51.   ======================================  
  52.  

【編輯推薦】

  1. Linux下vsftp服務(wù)器配置
  2. vsFTPd服務(wù)器的啟動(dòng)和關(guān)閉
  3. 怎樣安裝vsFTPd
  4. Linux下配置vsftpd
  5. vsftpd安裝篇
  6. vsftpd 啟動(dòng)篇
  7. Linux下vsftpd的配置
  8. 如果SELinux拒絕vsftpd上傳文件到用戶主目錄怎么辦
  9. vsFTPd常用功能之限速和限制鏈接點(diǎn)

 

責(zé)任編輯:zhaolei 來(lái)源: 網(wǎng)絡(luò)轉(zhuǎn)載
相關(guān)推薦

2011-02-23 09:55:33

Centos安裝vsftpd

2011-03-02 09:52:03

2011-02-23 15:50:04

Linuxvsftpd

2011-03-01 09:44:04

ubuntuvsftpd

2011-03-02 13:23:42

Vsftpd配置

2011-02-23 15:50:04

Linuxvsftpd

2011-02-23 17:23:35

linux vsftpd

2011-02-22 13:28:43

Linuxvsftpd配置

2011-03-07 09:11:31

Vsftpd檔案

2010-02-22 18:27:14

CentOS vsft

2010-12-27 13:26:25

FreeBSDvsftpd虛擬用戶

2011-03-07 09:37:32

Vsftpd啟動(dòng)CentOS

2010-01-13 13:50:53

CentOS Vsft

2010-02-22 18:12:25

CentOS vsft

2010-01-13 14:45:25

CentOS配置

2010-02-22 17:45:50

CentOS VSFT

2011-03-02 11:32:55

vsftpd配置

2010-01-13 13:27:07

CentOS vsft

2010-01-11 14:46:41

vsftpd配置

2011-02-23 14:38:39

安裝CentOS vsftpd
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)