ºìÁªLinuxÃÅ»§
Linux°ïÖú

LinuxÏÂFTPÐéÄâÓû§µÄʹÓÃÅäÖÃ

·¢²¼Ê±¼ä:2009-10-14 14:44:31À´Ô´:ºìÁª×÷Õß:bdsnmp
LinuxµÄFTP·þÎñÖ§³Ö3ÖÖÓû§:

1.ÄäÃûÕÊ»§

2.±¾µØÕÊ»§

3.ÐéÄâÓû§

ΪʲôҪʹÓÃÐéÄâÓû§:

ÄäÃûÕÊ»§¿ÉÒԺܺõı£Ö¤FTP·þÎñÆ÷µÄ°²È«ÐÔ,µ«ÊÇ,¶ÔÄäÃûÓû§µÄȨÏÞ¹ÜÀí²»¹»Áé»î.Èç¹ûÏë¶Ô·ÃÎÊFTPµÄÕÊ»§¸øÓè¸ü¶àµÄȨÏÞ,¾Í¿ÉÒÔÓñ¾µØÕÊ»§À´ÊµÏÖ.µ«ÊÇ,±¾µØÕÊ»§Ä¬ÈÏÇé¿öÏÂÊÇ¿ÉÒԵǽLinuxϵͳµÄ,ÕâÑù¶ÔLinuxϵͳÀ´ËµÊÇÒ»¸ö°²È«Òþ»¼.ÄÇôÔõôÄÜÔÚÁé»îµÄ¸³ÓèFTPÓû§È¨ÏÞµÄÇ°ÌáÏÂ,±£Ö¤FTP·þÎñÆ÷ÄËÖÁÕû¸öLinuxϵͳµÄ°²È«ÄØ?ʹÓÃÐéÄâÓû§¾ÍÊÇÒ»ÖÖ½â¾ö°ì·¨.

ÏÂÃ棬ÎÒÃǾÍÒ»ÆðÀ´Ñ§Ï°,¸ÃÔõÑùÔÚLinuxÏÂÅäÖÃFTP·þÎñÆ÷µÄÐéÄâÓû§.

¿ªÊ¼ÅäÖÃÇ°£¬ÈÃÎÒÃÇÏÈ´ó¸ÅÁ˽âÏÂFTPÐéÄâÓû§µÄ¹¤×÷Ô­Àí:

ÐéÄâÓû§,¹ËÃû˼Òå,²¢²»ÊÇÒ»¸öºÏ·¨µÄLinuxϵͳÕÊ»§,µ«ÊÇËû¿ÉÒÔÓÃÀ´µÇ½¸ÃϵͳÉÏÔËÐеÄFTP·þÎñÆ÷.

µ±Óû§ÔÚÁ¬½ÓÉÏFTP·þÎñÆ÷ºó,»á±»ÒªÇóÊäÈëÓû§ÃûºÍÃÜÂë.FTP·þÎñÆ÷ÔÚÄõ½Õâ¸öÓû§ÃûºÍÃÜÂëºó,»áµ÷ÓÃÏàÓ¦µÄPAMÈÏ֤ģ¿é¶Ô,ºÍϵͳÖеÄFTPÈÏÖ¤Îļþ½øÐÐÏà±È½Ï.Èç¹û¸ÃÓû§ÃûºÍÃÜÂëÓëFTPÈÏÖ¤ÎļþÖеÄijÌõ¼Ç¼Ïà·û,¾Íͨ¹ýÈÏÖ¤,È»ºó¸ÃÕÊ»§¾Í±»Ó³Éä³ÉÒ»¸öLinuxϵı¾µØÕÊ»§,È»ºó¸ù¾ÝʹÓøñ¾µØÕÊ»§¶ÔFTP×ÊÔ´½øÐзÃÎÊ.·ñÔòÔò¶Ï¿ª¸ÃÁ¬½ÓÇëÇó.

Á˽âÁËFTPÐéÄâÓû§µÄ¹¤×÷Ô­Àíºó,ÎÒÃǾͿÉÒÔ¿ªÊ¼ÅäÖÃFTPÐéÄâÓû§ÁË.

Õû¸ö¹ý³Ì¿ÉÒÔ·ÖÕ⼸¸ö²½Öè:

1.×¼±¸Ò»¸öÐéÄâÓû§µÄ¿ÚÁî¿âÎļþ.¸ÃÎļþÖб£´æµÄÓû§ÃûºÍÃÜÂëÊÇÓû§Á¬½ÓFTP·þÎñÆ÷ʱ,ÐèÒªÊäÈëµÄÓû§ÃûºÍÃÜÂë.Îļþ¿ÉÒÔ×Ô¼º´´½¨,λÖÃÎ޹ؽôÒª,Îļþ¸ñʽΪ:ÆæÊýÐÐΪÓû§Ãû,żÊýÐÐΪÃÜÂë.

ÀýÈç:touch login.txt //´´½¨Ò»¸öÃûΪlogin.txtµÄÐéÄâÓû§¿ÚÁî¿âÎļþ

vi login.txt //±à¼­¸Ã¿ÚÁî¿âÎļþ

mike //ÐéÄâÓû§mike

123 //ÐéÄâÓû§mikeµÄÃÜÂë

john //ÐéÄâÓû§john

321 //ÐéÄâÓû§johnµÄÃÜÂë

±£´æÍ˳ö.

2.ÓøղŽ¨Á¢µÄÐéÄâÓû§¿ÚÁî¿âÎļþÉú³ÉFTP·þÎñÆ÷µÄÈÏÖ¤Îļþ.¸ÃÈÏÖ¤ÎļþÊÇÒ»¸ö±»¼ÓÃܺóµÄÃÜÎÄ.PAMÔÚµ÷ÓÃÏàÓ¦µÄÈÏ֤ģ¿éºó,»á¶Ô´ÓFTP·þÎñÆ÷·¢À´µÄÓû§ÃûºÍÃÜÂë½øÐмÓÃÜ,È»ºóÔÚ¸ú¸ÃÎļþ½øÐжԱÈ,·¢ÏÖÏà·ûÌõÄ¿ºó,µÇ½Óû§²Å»á±»ÔÊÐíµÇ½.

db_load -T -t hash -f login.txt /etc/vsftpd/vsftpd_login.db

//ÔÚÔËÐиÃÃüÁîÇ°,±ðÍü¼Ç°²×°db4-utilsÈí¼þ°ü,¸Ã°ü°üº¬ÓÐdb_loadÃüÁîµÈ.¹ØÓÚ¸ÃÃüÁîµÄʹÓò»ÔÚ±¾ÎÄÌÖÂÛ·¶Î§ÄÚ.ÆäÖÐ-f²ÎÊýºó¸úµÄΪ¸Õ²Å´´½¨µÄÐéÄâÓû§¿ÚÁî¿âÎļþ.×îºóµÄ·¾¶ÎªÉú³ÉµÄFTPÈÏÖ¤ÎļþµÄ´æ·ÅλÖÃ.

ΪÁ˽øÒ»²½±£Ö¤°²È«,¿ÉÒÔ½«¸ÃFTPÈÏÖ¤ÎļþµÄȨÏÞÉèÖÃΪ600.

3.½¨Á¢ÐéÄâÓû§ËùÐèÒªµÄPAMÅäÖÃÎļþ.ÓÉÓÚFTP·þÎñÆ÷ÔÚ½ÓÊܵ½Óû§µÄÓû§ÃûºÍ¿ÚÁîºó»áµ÷ÓÃPAMÈÏÖ¤,ËùÒÔÎÒÃÇ»¹Òª´´½¨ÐéÄâÓû§µÄPAMÅäÖÃÎļþ.

ÎÒÃǽ«¸ÃÎļþ±£´æÔÚ/etc/pam.dĿ¼ÏÂ,ÎļþÃûÔÝʱȡΪ:vsftpd.ÕâÀïҪעÒâÒ»µã¾ÍÊÇ,¸ÃÎļþÃûÒªÓëFTP·þÎñÖ÷ÅäÖÃÎļþ(/etc/vsftpd/vsftpd.conf)ÖеÄpam_service_name=vsftpdÑ¡ÏîµÄÑ¡ÏîÖµÏàͬ.

´´½¨ºÃ¸ÃÎļþºó,½«ÏÂÃæµÄÄÚÈݼÓÈëµ½¸ÃÎļþÖÐ:

auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login

account required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login

¸ÄºÃºó,±£´æÍ˳ö.×¢Òâ3¸öºìÉ«ÎļþµÄÎļþÃû.¸Ã3¸öÎļþΪ1¸öÎļþ,Ö»²»¹ýÔÚʹÓÃÖÐд·¨²»Í¬.

4.ÓÉÓÚÓû§ÔÚͨ¹ýPAMµÄÈÏÖ¤ºóÒª±»Ó³Éä³ÉÒ»¸ö±¾µØÓû§,ËùÒÔÎÒÃÇ»¹Òª½¨Á¢Ò»¸ö±¾µØÓû§¹©ÐéÄâÓû§Ê¹ÓÃ.

ÎÒÃÇÖ»ÐèÒª¶Ô¸Ã±¾µØÓû§¸³ÓèFTPÖ÷Ŀ¼µÄÊʵ±·ÃÎÊȨÏÞ¾ÍÐÐ.¼´Ê¹FTP·þÎñÆ÷Ôâµ½¹¥»÷,Õâ¸ö±¾µØÓû§Ò²Ã»ÓзÃÎÊÆäËûĿ¼µÄȨÏÞ,Ïà¶Ô±È½Ï°²È«Ò»Ð©.

useradd -d /home/ftpsite virtual //Óû§ÃûΪvirtual,Ö÷Ŀ¼ΪFTPµÄ¸ù

chmod 700 /home/ftpsite //½«ÆäȨÏÞÉèÖÃΪ700,¿ÉÒÔ¸ù¾Ýʵ¼ÊÇéÐνøÐÐÐÞ¸Ä

5.ÔÚFTPµÄÖ÷ÅäÖÃÎļþÖÐ,ÆôÓÃFTPÐéÄâÓû§.Ôö¼ÓÈçÏÂÑ¡Ïî¼´¿É:

guest_enable=YES

guest_username=virtual //½«ÐéÄâÓû§Ó³Éä³É±¾µØµÄÄĸöÓû§.ÕâÀïÓõÄÊÇvirtual,¸Õ²Å½¨

Á¢µÄÄǸöÓû§.

pam_service_name=/etc/vsftpd/vsftpd //ÇмÇÒªÐ޸ĸÃÏîµÄÖµ

6.ÅäÖõ½ÕâÀï¾ÍÍê³ÉÁË,±ðÍü¼ÇÖØÆôFTP·þÎñ½øÐвâÊÔ.

7.Ϊ²»Í¬µÄÐéÄâÓû§·ÖÅäȨÏÞ

ĬÈÏÇé¿öÏÂ,ÐéÄâÓû§ÓµÓÐÏàͬµÄȨÏÞ,¾ÍÊÇvirtualµÄȨÏÞ,ÎÒÃÇ¿ÉÒÔ¸ù¾Ýʵ¼ÊÐèÇó¶Ô²»Í¬µÄÐéÄâÓû§·ÖÅäȨÏÞ.

Ê×ÏÈÔÚFTPµÄÖ÷ÅäÖÃÎļþÖмÓÒ»¸öÑ¡Ïî:

user_config_dir=/etc/vsftpd_user_conf //ÎļþÃûºÍ·¾¶¶¼¿ÉÒÔ×Ô¼º¶¨Òå

È»ºó´´½¨¸ÃĿ¼.

mkdir /etc/vsftpd_user_conf

ÏÂÃæ¾Í¿ÉÒÔÔÚ¸ÃĿ¼Ï±༭²»Í¬ÐéÄâÓû§µÄȨÏÞÅäÖÃÎļþÁË,±ÈÈçÒª¶Ômike±à¼­ÆäȨÏÞ.

touch mike //½¨Á¢mikeµÄȨÏÞÎļþ.ÎļþÃûÒªÓëÐéÄâÓû§ÃûÏàͬ

¿ÉÒÔ¸ù¾Ýʵ¼ÊÐèÇóΪ¸ÃÎļþÌí¼ÓÏÂÃæµÄÑ¡ÏîºÍÖµ:

anon_world_readable_only=NO //±íʾÓû§¿ÉÒÔä¯ÀÀFTPĿ¼ºÍÏÂÔØÎļþ

anon_upload_enable=YES //±íʾÓû§¿ÉÒÔÉÏ´«Îļþ

anon_mkdir_write_enable=YES //±íʾÓû§Óд´½¨ºÍɾ³ýĿ¼µÄȨÏÞ

anon_other_write_enable=YES //±íʾÓû§¾ßÓÐÎļþ¸ÄÃûºÍɾ³ýÎļþµÄȨÏÞ



µ½ÕâÀï,ÐéÄâÓû§¾ÍËãÍê³ÉÅäÖÃÍê³ÉÁË.
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 29 ÌõÆÀÂÛ

  1. zlyzx1000 ÓÚ 2013-06-04 14:33:57·¢±í:

    :0w5ty(1

  2. zhangjp_jp ÓÚ 2013-03-27 13:49:37·¢±í:

    ¸ú×Åѧϰѧϰ£¬¸Ðл

  3. ʯͷÍæ¼Ò ÓÚ 2013-01-16 13:49:43·¢±í:

    ´ËÌù±Ø»ð£¡(q):s

  4. zhangasd123 ÓÚ 2013-01-13 20:38:51·¢±í:

    Â¥Ö÷½²µÄºÜÏêϸ£¬¹ÄÕÆ£¡£¡£¡£¡

  5. 12700696 ÓÚ 2012-12-25 11:10:10·¢±í:

    :0)1

  6. jhyeqf ÓÚ 2012-12-19 22:19:05·¢±í:

    лл¥Ö÷,ѧϰÀ²1

  7. andrea ÓÚ 2012-12-14 23:20:07·¢±í:

    ºÜÇ¿´ó

  8. °¢À³82 ÓÚ 2012-08-08 08:23:18·¢±í:

    ѧϰÁË£¬Ð»Ð»

  9. uwif8144 ÓÚ 2012-07-07 07:45:34·¢±í:

    ?accordingly, to win the national popular vote, a candidate must appeal to the large majority of americans who do not live in these urban centers. at the state level, candidates do not spend all their time and resources only in urban centers. in 2010, texas governor rick perry was re-elected by 13 percentage points, despite being overwhelmingly defeated in the state's two largest cities: houston and dallas. in fact, these two loan star cities are two of the largest populated u.s. cities. in new york, george pataki served three terms as governor despite the fact that he was wiped out in the nation's largest city, new york city. finally, california has elected four governors in the last 46 years who did not even come close to carrying the state's largest city, los angeles.
    lewis is correct when he opines: "a republic does not rest on pure majority (mob?) rule. it incorporates various checks and balances to filter the majority and protect the minority."
    yet the npvi in no way establishes "mob rule." the template for the governance system that the founding fathers established came from the roman republic. under the roman system, the people do not directly govern themselves. instead, they select fellow citizens to represent them, and these representatives in turn determine who will hold the office of the presidency. under "mob rule" the citizenry would vote on the issues themselves and the majority vote would decide the outcome. this is diametrically opposed to what the npvi is advocating.

  10. guhaooo ÓÚ 2012-06-22 20:55:31·¢±í:

    ¸Ðл·ÖÏí ²»¹ý¸Ð¾õ»¹ÊÇpdfÓõÄʱºòÕý¹æЩ

  11. helloluxinyi ÓÚ 2012-02-05 12:18:43·¢±í:

    {:2_91:}

  12. pbb7771930 ÓÚ 2012-02-04 13:31:34·¢±í:

    ºÃºÃѧϰ£¬ÌìÌìÏòÉÏ

  13. jogahou_xym ÓÚ 2011-12-20 20:25:39·¢±í:

    ѧϰÁË£¬Ð»Ð»£¡

  14. lsj ÓÚ 2011-12-15 14:14:44·¢±í:

    ѧϰ£¡£¡

  15. yjh277 ÓÚ 2011-12-10 12:12:55·¢±í:

    ѧϰ

  16. lsff ÓÚ 2011-11-07 21:12:57·¢±í:

    ѧϰÁË¡£¡£¡£

  17. hhj_321 ÓÚ 2011-11-01 12:11:31·¢±í:

    ÏÈÊÕ²ØÆðÀ´ÁË

  18. haoge512 ÓÚ 2011-10-31 22:19:50·¢±í:

    ¶¥

  19. qamallan ÓÚ 2011-03-28 13:41:14·¢±í:

    ²»´í£¬Ö§³Ö

  20. yangjiancsdn ÓÚ 2011-03-25 23:41:51·¢±í:

    ºÃÌù£¡£¡£¡

  21. q7262395 ÓÚ 2011-03-25 14:31:18·¢±í:

    ²»´íµÄ¼¼Êõ£¬Ñ§Ï°ÁË£¬ÕýºÃÓÃÉÏ

  22. weixiaoyu111 ÓÚ 2011-01-04 13:10:13·¢±í:

    ΪΪΪwwwwwwwww

  23. lklangzi ÓÚ 2010-02-06 09:23:13·¢±í:

    ѧϰÖÐ

  24. liaolily ÓÚ 2010-01-29 21:58:56·¢±í:

    1# bdsnmp


    Thanks!

  25. read ÓÚ 2010-01-28 16:39:58·¢±í:

    Á˽âһϣ¡ºÜÏêϸ£¡

  26. wAe]levis ÓÚ 2010-01-28 15:12:32·¢±í:

    (5ty(

  27. yong009003 ÓÚ 2010-01-19 13:33:29·¢±í:

    Á˽âһϣ¡:0()w(1

  28. zln060618 ÓÚ 2009-10-14 18:22:49·¢±í:

    {:2_92:}

  29. weimian ÓÚ 2009-10-14 15:13:43·¢±í:

    ѧϰһÏÂ