Ukwakha isiphakeli se-FTP ku-Linux

Ukudluliswa kwamafayela kwinethiwekhi kwenziwa ngenxa yesiphakeli se-FTP esilungiselelwe kahle. Le protocol isebenza ngokusebenzisa isakhiwo se-TCP iklayenti-iseva futhi isebenzisa ukuxhumeka kwenethiwekhi ehlukahlukene ukuqinisekisa ukudluliswa kwemilayezo phakathi kwama-node axhunyiwe. Abasebenzisi abaxhumeke kwinkampani ethile yokubamba babhekene nesidingo sokusetha isiphakeli se-FTP siqu ngokuvumelana nezidingo zenkampani enikeza izinsizakalo zokugcinwa kwewebhusayithi noma ezinye izinhlelo zokusebenza. Okulandelayo, sizobonisa indlela yokwakha insizakalo enjalo ku-Linux besebenzisa isibonelo sesinye sezidingo.

Dala isiphakeli se-FTP ku-Linux

Namuhla sizosebenzisa ithuluzi elibizwa nge-VSftpd. Izinzuzo zeseva ye-FTP enjalo ukuthi ngokuzenzakalelayo isebenza ezinkambisweni eziningi zokusebenza, igcina izimpahla ezisemthethweni zokusabalalisa ezahlukahlukene ze-Linux futhi kulula ukuzimisela ukusebenza okulungile. Ngendlela, le FTP ethile isetshenziswa ngokomthetho kwi-Linux kernel, futhi izinkampani eziningi zokubamba zincoma ukufaka i-VSftpd. Ngakho-ke, masiqaphele inqubo yesinyathelo ngesinyathelo sokufaka nokulungisa izingxenye ezidingekayo.

Isinyathelo 1: Faka i-VSftpd

Ngokuzenzakalelayo, wonke amashabhulali e-VSftpd adingekayo ekusakazeni ayitholakali, ngakho-ke kufanele alayishwe ngesandla nge-console. Lokhu kwenziwa kanje:

  1. Vula "Isikhumbuzo" noma iyiphi indlela elula, isibonelo, ngokusebenzisa imenyu.
  2. Abanikazi bezinguqulo zeDebian noma Ubuntu kudingeka babhalise umyalo.sudo apt-get ukufaka i-vsftpd. I-CentOS, i-Fedora -yum ufake i-vsftpd, nakuGentoo -ivela vsftpd. Ngemuva kwesingeniso, chofoza Ngenaukuqala inqubo yokufaka.
  3. Qinisekisa ukuthi unamalungelo nge-akhawunti yakho ngokucacisa iphasiwedi efanelekile.
  4. Linda amafayela amasha ukuthi angeziwe ohlelweni.

Sibheka ukunakwa kwabanikazi be-CentOS, abasebenzisa iseva ye-virtual ezinikezele kunoma yikuphi ukubamba. Kuzodingeka ubuyekeze imodemu ye-kernel ye-OS, ngoba ngaphandle kwale nqubo, iphutha elibucayi lizovela ngesikhathi sokufakwa. Faka ngokuphumelelayo imiyalo elandelayo:

Yum update
rpm -Uvh //www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
Yumfaka i-yum-plugin-fastestmirror
wget //mirrors.neterra.net/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-3.15.6-1.el7.elrepo.x86_64.rpm
Yum ufake i-kernel-ml-3.15.6-1.el7.elrepo.x86_64.rpm
wget //mirrors.neterra.net/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-devel-3.15.6-1.el7.elrepo.x86_64.rpm
yum ufake i-kernel-ml-devel-3.15.6-1.el7.elrepo.x86_64.rpm
wget //mirrors.neterra.net/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-doc-3.15.6-1.el7.elrepo.noarch.rpm
Yum ufake i-kernel-ml-doc-3.15.6-1.el7.elrepo.noarch.rpm
wget //mirrors.neterra.net/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-headers-3.15.6-1.el7.elrepo.x86_64.rpm
yum ufake i-kernel-ml-headers-3.15.6-1.el7.elrepo.x86_64.rpm
wget //mirrors.neterra.net/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-tools-3.15.6-1.el7.elrepo.x86_64.rpm
wget //mirrors.neterra.net/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-tools-libs-3.15.6-1.el7.elrepo.x86_64.rpm
Yum ufake i-kernel-ml-amathuluzi-libs-3.15.6-1.el7.elrepo.x86_64.rpm
Yum ufake i-kernel-ml-amathuluzi-3.15.6-1.el7.elrepo.x86_64.rpm
wget //mirrors.neterra.net/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-tools-libs-devel-3.15.6-1.el7.elrepo.x86_64.rpm
yum ufake i-kernel-ml-tools-libs-devel-3.15.6-1.el7.elrepo.x86_64.rpm
wget //mirrors.neterra.net/elrepo/kernel/el7/x86_64/RPMS/perf-3.15.6-1.el7.elrepo.x86_64.rpm
Yum ufake perf-3.15.6-1.el7.elrepo.x86_64.rpm
wget //mirrors.neterra.net/elrepo/kernel/el7/x86_64/RPMS/python-perf-3.15.6-1.el7.elrepo.x86_64.rpm
Yum ufake python-perf-3.15.6-1.el7.elrepo.x86_64.rpm
yum --enablerepo = elrepo-kernel faka kernel-ml

Ngemuva kokuphela kwalenqubo yonke, sebenzisa ifayela lokucushwa kunoma iyiphi indlela elula./boot/grub/grub.conf. Shintsha okuqukethwe kwayo ukuze imingcele elandelayo ibe namanani afanelekayo:

okuzenzakalelayo = 0
isikhathi sokuhamba = 5
isihloko vmlinuz-4.0.4-1.el7.elrepo.x86_64
impande (hd0,0)
i-kernel /boot/vmlinuz-4.0.4-1.el7.elrepo.x86_64 i-console = ama-hcc0 xencons = tty0 impande = / dev / xvda1 ro
initrd /boot/initramfs-4.0.4-1.el7.elrepo.x86_64.img

Khona-ke kufanele uqalise kabusha iseva ezinikezele futhi uqhubekele ekufakweni ngokushesha kwe-FTP iseva kukhompyutha.

Isinyathelo 2: Isethaphu Yeseva Yokuqala Ye-FTP

Kanye nalolu hlelo, ifayela layo lokucushwa lalayishwa kukhompyutha, kusukela lapho iseva ye-FTP isebenza khona. Zonke izilungiselelo zenziwe ngokuzenzakalelayo ngabanye ezincomo zokusingatha noma okuthandayo. Singabonisa kuphela ukuthi leli fayili livuliwe nokuthi yimiphi imigomo okufanele iqondwe ngayo.

  1. Kuhlelo lwe-Debian noma lwe-Ubuntu, ifayela lokucushwa lisebenza kanje:sudo nano /etc/vsftpd.conf. Ku-CentOS no-Fedora kusendleleni./etc/vsftpd/vsftpd.conf, naseGentoo -/etc/vsftpd/vsftpd.conf.example.
  2. Ifayela ngokwayo liboniswa ku-console noma umhleli wombhalo. Lapha uqaphele amaphuzu angezansi. Kufayela lakho lokucushwa, kufanele babe namanani afanayo.

    engaziwa_enable = CHA
    lendawo_enable = YEBO
    bhala_fanele = YEBO
    chroot_local_user = YEBO

  3. Yenza okunye ukuhlela ngokwakho, bese ungakhohlwa ukusindisa izinguquko.

Isinyathelo 3: Ukwengeza Umsebenzisi Okuthuthukile

Uma uzosebenza nesiphakeli se-FTP hhayi nge-akhawunti yakho eyinhloko noma ufuna ukunikeza ukufinyelela kwabanye abasebenzisi, amaphrofayela adalwe kumele abe namalungelo angaphezu kwamandla amakhulu ukuze uma ufinyelela ku-VSftpd yesevisi awekho amaphutha anokufinyelela okunqatshiwe.

  1. Qalisa "Isikhumbuzo" bese ufaka umyaloumsebenzisi we-sudo add1kuphi umsebenzisi1 - igama le-akhawunti entsha.
  2. Setha iphasiwedi, bese uyiqinisekisa. Ngaphezu kwalokho, sincoma ngokuqinile ukukhumbula isiqondisi sasekhaya se-akhawunti, esikhathini esizayo ungase udingeke ukuyifinyelela ngokusebenzisa i-console.
  3. Gcwalisa ulwazi oluyisisekelo - igama eligcwele, inombolo yekamelo, izinombolo zocingo kanye nolunye ulwazi, uma kudingeka.
  4. Ngemuva kwalokho, vumela amalungelo omsebenzisi athulwe ngokufaka umyalosudo adduser user1 sudo.
  5. Dala umsebenzisi incwadi ehlukile yokugcina amafayela akhe ngokusebenzisasudo mkdir / ekhaya / user1 / amafayela.
  6. Okulandelayo, hamba kufolda yakho ekhayacd / ekhayafuthi lapho wenza umsebenzisi omusha umnikazi we-directory yakho ngokuthayiphaImpande ekhonyiwe: impande / ikhaya / umsebenzisi1.
  7. Qala kabusha iseva ngemva kokwenza zonke izinguquko.I-sudo service vsftpd iqala kabusha. Kukwabiwa kwe-Gentoo kuphela, i-Umbuso uqala kabushaqala kabusha /etc/init.d/vsftpd.

Manje ungenza zonke izenzo ezidingekayo kuseva ye-FTP egameni lomsebenzisi omusha oye wandise amalungelo okufinyelela.

Isinyathelo 4: Lungisa i-Firewall (Ubuntu kuphela)

Abasebenzisi bezinye izimpahla bangakwazi ukweqa lesi sinyathelo ngokuphepha, ngoba ukumiswa kwe-port akusadingeki noma kuphi, kuphela ku-Ubuntu. Ngokuzenzakalelayo, i-Firewall ihlelwe ngendlela yokuthi ngeke ivumele ithrekhi engenayo esuka kwamakheli esiwadingayo, ngakho-ke, kuzodingeka sivumele ukuhamba kwayo ngesandla.

  1. Ku-console, sebenzisa imiyalo ngayinye.sudo ufw khubazafuthisudo ufw ukuvumelaukuqala kabusha i-firewall.
  2. Engeza imithetho engenayo ngokusebenzisasudo ufw vumela 20 / tcpfuthisudo ufw vumela 21 / tcp.
  3. Hlola ukuthi ngabe imithetho isetshenzisiwe ngokubuka isimo se-firewallsudo ufw isimo.

Ngokuhlukile, ngifuna ukukhuluma ngemilayezo embalwa ewusizo:

  • qala /etc/init.d/vsftpdnomaservice vsftpd ekuqaleni- ukuhlaziywa kwefayela lokumisa;
  • netstat -tanp | I-grep LALA- ukuhlola ukufaneleka kokufakwa kwesiphakeli se-FTP;
  • indoda vsftpd- shayela imibhalo esemthethweni ye-VSftpd ukucinga ulwazi oludingekile mayelana nokusebenza kosizo;
  • ukuqala kabusha kwe-vsftpd yesevisinomaqala kabusha /etc/init.d/vsftpd- iseva kabusha.

Ngokuphathelene nokufinyelela ku-FTP-server futhi uqhubeke usebenza nayo, xhumana ukuze uthole le datha kubamele abamba ukubamba kwakho. Kusuka kubo, uzokwazi ukucacisa ulwazi mayelana nokuqaphela kokuhlelwa nokuvela kwamaphutha ahlukahlukene.

Lesi sihloko siphelile. Namuhla sihlaziye inqubo yokufaka ye-VSftpd iseva ngaphandle kokubophezelwa kunoma iyiphi inkampani yokubamba, ngakho gcina lokhu engqondweni uma uqhuba imiyalelo yethu bese uwaqhathanisa nalabo abanikezwa yinkampani equkethe iseva yakho ebonakalayo. Ngaphezu kwalokho, sineluleka ukuba uzijwayele nezinye izinto zethu, ezibhekana nesihloko sokufakwa kwezingxenye ze-LAMP.

Bheka futhi: Ukufaka i-LAMP suite ku-Ubuntu