Ho theha Server ea FTP ho Linux

Pin
Send
Share
Send

Ho fetisoa ha faele marang-rang ho etsoa ka lebaka la seva e hlophisitsoeng hantle ea FTP. Protocol e joalo e sebetsa ka ho sebelisa TCP ho moralo oa seva sa bareki mme e sebelisa likhokahano tse fapaneng tsa netweke ho netefatsa phetisetso ea litaelo lipakeng tsa libaka tse hokahaneng. Basebelisi ba hokahaneng le kamohelo e itseng ba tobane le tlhoko ea ho hlophisa seva ea FTP ea motho ka mong ho latela litlhoko tsa k'hamphani e fanang ka lits'ebeletso tsa tlhokomelo ea sebaka kapa software e ngoe. Ka mor'a moo, re tla bonts'a mokhoa oa ho theha seva e joalo ho Linux re sebelisa e 'ngoe ea lisebelisoa joalo ka mohlala.

Theha seva ea FTP ho Linux

Kajeno re tla sebelisa sesebelisoa se bitsoang VSftpd. Melemo ea seva e joalo ea FTP ke hore e sebetsa lits'ebetsong tse ngata ka ho iketsetsa, e boloka li-repositori tsa semmuso tsa phano e fapaneng ea Linux, 'me ho bonolo ho e hlophisa bakeng sa ts'ebetso e nepahetseng. Ka tsela, FTP ena e sebelisoa ka molao kontinent ea Linux, 'me lik'hamphani tse ngata tse amohelang ba khothaletsa ho kenya VSftpd. Ka hona, ha re shebisiseng tlhokomelo ea mohato ka mohato le tlhophiso ea likarolo tse hlokahalang.

Mohato oa 1: Kenya VSftpd

Ka kamehla, lilaebrari tsohle tse hlokoang tsa VSftpd ha li kenyellelelloe ka thomello, ka hona o hloka ho li jarolla ka likhoka. E etsoa tjena:

  1. Bula "Mokhatlo oa" terminal " mokhoa ofe kapa ofe o bonolo, ho etsa mohlala, ka menu.
  2. Beng ba mefuta ea Debian kapa Ubuntu ba hloka ho ngolisa taelosudo apt-kenya kenya vsftpd. CentOS, Fedora -yum kenya vsftpd, le bakeng sa Gentoo -hlaha vsftpd. Kamora ho kenyelletsa, tobetsa Kenaho qala ts'ebetso ea ho kenya.
  3. Netefatsa akhaonto ea hau ka password e nepahetseng.
  4. Emela ho phethoa ha ho kenyelletsa lifaele tse ncha tsamaisong.

Re hohela tlhokomelo ea beng ba CentOS ba sebelisang seva e ikemiselitseng ho tsoa ho mofani leha e le ofe. U tla hloka ho ntlafatsa module ea kernel ea OS, hobane ntle le ts'ebetso ena phoso e tebileng e tla hlaha nakong ea ho kenya. Kenya litaelo tse latelang ka tatellano:

ntjhafatso ea yum
rpm -Uvh //www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
Yum kenya yum-plugin-fastestmirror
wget //mirwering.neterra.net/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-3.15.6-1.el7.elrepo.x86_64.rpm
yum kenya kernel-ml-3.15.6-1.el7.elrepo.x86_64.rpm
wget //mir makosa.net.tv.net/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-devel-3.15.6-1.el7.elrepo.x86_64.rpm
yum kenya kernel-ml-devel-3.15.6-1.el7.elrepo.x86_64.rpm
wget //mir makosa.net.tv.net/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-doc-3.15.6-1.el7.elrepo.noarch.rpm
yum kenya kernel-ml-doc-3.15.6-1.el7.elrepo.noarch.rpm
wget //mirwering.neterra.net/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-headers-3.15.6-1.el7.elrepo.x86_64.rpm
yum kenya kernel-ml-headers-3.15.6-1.el7.elrepo.x86_64.rpm
wget //mirwering.neterra.net/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-tools-3.15.6-1.el7.elrepo.x86_64.rpm
wget //mirwering.neterra.net/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-tools-libs-3.15.6-1.el7.elrepo.x86_64.rpm
yum kenya kernel-ml-lisebelisoa-libs-3.15.6-1.el7.elrepo.x86_64.rpm
yum kenya kernel-ml-lisebelisoa-3.15.6-1.el7.elrepo.x86_64.rpm
wget //mir makosa.net.tv.net/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-tools-libs-devel-3.15.6-1.el7.elrepo.x86_64.rpm
yum kenya kernel-ml-lisebelisoa-libs-devel-3.15.6-1.el7.elrepo.x86_64.rpm
wget //mir makosa.net.tv.net/elrepo/kernel/el7/x86_64/RPMS/perf-3.15.6-1.el7.elrepo.x86_64.rpm
yum kenya perf-3.15.6-1.el7.elrepo.x86_64.rpm
wget //mir makosa.net.tv.net/elrepo/kernel/el7/x86_64/RPMS/python-perf-3.15.6-1.el7.elrepo.x86_64.rpm
yum kenya python-perf-3.15.6-1.el7.elrepo.x86_64.rpm
yum --enablerepo = elrepo-kernel kenya kernel-ml

Kamora ho sebelisa mokhoa ona, tsamaisa faele ea tlhophiso ka tsela efe kapa efe e bonolo./boot/grub/grub.conf. Fetola litaba tsa teng e le hore qetellong likarolo tse latelang li be le litekanyetso tse nepahetseng:

kamehla = 0
nako = 5
sehlooho vmlinuz-4.0.4-1.el7.elrepo.x86_64
motso (hd0.0)
kernel /boot/vmlinuz-4.0.4-1.el7.elrepo.x86_64 console = hvc0 xencons = tty0 motso = / dev / xvda1 ro
initrd /boot/initramfs-4.0.4-1.el7.elrepo.x86_64.img

Ebe u tlameha ho qala seva e inehetseng ebe u tsoelapele ho kenya ts'ebetso ea seva ea FTP khomphuteng.

Mohato oa Bobeli: Ho qala ka seva ea FTP

Hammoho le lenaneo, faele ea eona ea tlhophiso e kopitsoe khomphuteng, ho qala ho tloha moo seva ea FTP e sebetsang teng. Litlhophiso tsohle li etsoa ka mokhoa o ikhethileng ho latela likhothaletso tsa moamoheli kapa thato ea hau. Re ka bontša feela hore na file ena e buloa joang le hore na ho hlokahala hore ho mameloe maemo afe.

  1. Ho Sistimi ea Debian kapa Ubuntu, faele e hlophisitsoeng e sebetsa tjena:sudo nano /etc/vsftpd.conf. Ho CentOS le Fedora, e tseleng/etc/vsftpd/vsftpd.confle Gentoo -/etc/vsftpd/vsftpd.conf.ex mohlala.
  2. Faele ka boeona e hlaha ho khokahanyo kapa lenaneong la mongolo. Ka kopo hlokomela lintlha tse ka tlase. Faeleng ea hau ea tlhophiso, ba lokela ho ba le boleng bo tšoanang.

    anonymous_enable = NO
    local_enable = YES
    wrote_enable = YES
    chroot_local_user = YES

  3. Etsa tšebetso ea ho hlophisa tse setseng, 'me ka mor'a moo u se ke oa lebala ho boloka liphetoho.

Mohato oa 3: Ho eketsa mosebelisi ea tsoetseng pele

Haeba u sa sebetse le seva sa FTP ka akhaonto ea hau ea mantlha kapa u batla ho fana ka phihlello ea basebelisi ba bang, lifaele tse entsoeng li tlameha ho ba le litokelo tse phahameng e le hore ho fihlella ts'ebeliso ea VSftpd ho se bake liphoso tse hannoeng.

  1. Matha "Mokhatlo oa" terminal " ebe o kenya taelomosebelisi oa sudo1kae mosebelisi1 - Lebitso la ak'haonte e ncha.
  2. Ipeele phasewete, 'me ue tiise. Ntle le moo, re khothaletsa ka matla hore o hopole motsamaisi oa lehae oa ak'haonte; nakong e tlang u ka hloka ho e fumana ka khokahano.
  3. Tlatsa tlhaiso-leseling ea mantlha - lebitso le felletseng, nomoro ea kamore, linomoro tsa mohala le tlhaiso-leseling e ngoe, haeba ho hlokahala.
  4. Kamora moo, fa mosebelisi litokelo tse tsoetseng pele ka ho kenya taelosudo keeketso mosebelisi1 sudo.
  5. Theha directory se ka thoko bakeng sa mosebelisi ho boloka lifaele tsa hae kasudo mkdir / lapeng / user1 / lifaele.
  6. E latelang, fetela ho foldara ea hau ea lapengcd / lehae'me moo u etse mosebelisi e mocha lebitso la sisteme ea hau ka ho thaepachown motso: motso / home / user1.
  7. Qala seva ka mor'a ho etsa liphetoho tsohletšebeletso ea sudo vsftpd qala hape. Ke feela phepelong ea Gentoo moo ts'ebeliso e qalang hape/etc/init.d/vsftpd qala hape.

Joale o ka etsa liketso tsohle tse hlokahalang ho seva sa FTP lebitsong la mosebelisi e mocha ea nang le litokelo tsa ho fihlella tse tsoetseng pele.

Mohato oa 4: Lokisa firewall (Ubuntu Feela)

Basebelisi ba lipehelo tse ling ba ka tlola mohato ona ka mokhoa o sireletsehileng, kaha ho hlophisoa ha boema-kepe ha ho sa hlokahala kae kapa kae, ho Ubuntu feela. Ka phoso, Firewall e hlophisitsoe ka tsela e tla se lumelle sephethephethe se kenang ho tsoa liaterese tseo re li hlokang, ka hona o tla hloka ho lumella ho tsamaisoa ha eona ka letsoho.

  1. Mo khokahanong, kenya ts'ebetso litaelo ka bonngoesudo ufw qobellalesudo ufw thusaho qala firewall.
  2. Kenya melao e kenang ka haresudo ufw lumella 20 / tcplesudo ufw lumella 21 / tcp.
  3. Lekola hore na melao e kentsoeng e sebelisitsoe ka ho sheba boemo ba firewallboemo ba sudo ufw.

Ka thoko, ke batla ho hlokomela litaelo tse 'maloa tse sebetsang:

  • /etc/init.d/vsftpd qalakapatšebeletso vsftpd qala- Ts'ebetso ea faele e hlophisitsoeng;
  • netstat -tanp | TLHOKOMELA- netefatso ea ts'ebetso ea seva ea FTP;
  • monna vsftpd- letsetsa litokomane tsa semmuso tsa VSftpd ho fumana tlhaiso-leseling e hlokahalang mabapi le ts'ebetso ea ts'ebeliso;
  • tšebeletso vsftpd qala hapekapa/etc/init.d/vsftpd qala hape- server reboot.

Mabapi le phihlello ea seva ea FTP le ho sebetsa ka ho eketsehileng le eona, ikopanye le baemeli ba hau ba u amohelang ho fumana data ena. Le bona, o ka hlakisa tlhahisoleseling mabapi le ho potoloha ho potoloha le ho hlaha ha mefuta e fapaneng ea liphoso.

Paleng ena e ea fela. Kajeno re sekasekile mokhoa oa ho kenya seva ea VSftpd ntle le ho tlangoa ho moamoheli leha e le ofe, ka hona nahana ka sena ha u latela litaelo tsa rona mme u li bapise le tse fanoeng ke k'hamphani e nang le seva ea hau e hlakileng. Ntle le moo, re khothaletsa hore o ithute lisebelisoa tsa rona tse ling tse buang ka sehlooho sa ho kenya likarolo tsa LAMP.

Bona hape: Ho kenya LAMP Software Suite ho Ubuntu

Pin
Send
Share
Send