Ho theha seva sa FTP Linux

Ho fetisoa ha lifaele ho marang-rang ho etsoa ka lebaka la seva sa FTP se lokiselitsoeng hantle. Tsamaiso ena e sebetsa ka mokhoa oa ts'ebetso oa basebetsi ba TCP le sebedisa marang-rang a fapaneng a marang-rang ho etsa bonnete ba ho fetisoa ha litaelo pakeng tsa li-node tse amanang. Basebedisi ba ikopantseng le khamphani e itseng ea hosting ba tobane le tlhokahalo ea ho theha seva sa FTP sa bona ho ea ka litlhoko tsa k'hamphani e fanang ka litšebeletso tsa tlhokomelo ea marang-rang kapa lisebelisoa tse ling. E latelang, re tla bonts'a mokhoa oa ho theha seva ho Linux ho sebelisa mohlala oa e 'ngoe ea lisebelisoa.

Etsa seva sa FTP Linux

Kajeno re tla sebelisa sesebelisoa se bitsoang VSftpd. Melemo ea seva se joalo sa FTP ke hore ka ho sa feleng e tsamaisana le mekhoa e mengata ea ho sebetsa, e boloka litlaleho tsa molao tse fapaneng tsa liphallelo tsa Linux 'me e batla e le bonolo ho e lokisetsa ho sebetsa hantle. Ka tsela, FTP ena e sebelisoa ka molao ho Linux kernel, 'me lik'hamphani tse ngata tse amohelang li khothalletsa ho kenya VSftpd. Kahoo, a re ele hloko mohato oa mohato oa ho kenya le ho lokisa lintho tse hlokahalang.

Mohato oa 1: Kenya VSftpd

Ka ho feletseng, lilaebrari tsohle tsa VSftpd tse hlokahalang ha li fumaneha, ha hoa lokela hore li behoe ka letsoho ka console. Sena se etsoa ka tsela e latelang:

  1. Bula "Terminal" mokhoa leha e le ofe o loketseng, ka mohlala, ka har'a menu.
  2. Ba nang le liphetolelo tsa Debian kapa Ubuntu ba hloka ho ngolisa taelo.sudo apt-get kenya vsftpd. CentOS, Fedora -Yum kenya vsftpd, le bakeng sa Gentoo -hlaha vsftpd. Ka mor'a kenyelletso, tobetsa Kenyaho qala ts'ebetso ea ho kenya.
  3. Etsa bonnete ba hore u na le litokelo ka akhaonto ea hau ka ho hlakisa phasewete e nepahetseng.
  4. Emela hore lifaele tse ncha li kenyelelitsoe tsamaisong.

Re lebisa tlhokomelo ea beng ba CentOS, ba sebelisang seva se ikemetseng se ikemetseng ho tloha leha e le efe. O tla hloka ho ntlafatsa module ea OS kernel, hobane ntle le ts'ebetso ena, phoso e kholo e tla hlaha nakong ea kopo. Kenya ka katleho litaelo tse latelang:

tlhahiso ea yum
rpm -Uvh //www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
Yum kenya-fastestmirror yum-plugin
wget //mirrors.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 //mirrors.neterra.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 //mirrors.neterra.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 //mirrors.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 //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 kenya kernel-ml-tools-libs-3.15.6-1.el7.elrepo.x86_64.rpm
Yum kenya 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-devel-3.15.6-1.el7.elrepo.x86_64.rpm
Yum kenya 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 kenya 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 kenya python-perf-3.15.6-1.el7.elrepo.x86_64.rpm
Yum --enablerepo = elrepo-kernel kenya kernel-ml

Kamora ho fela ha mekhoa ena kaofela, tsamaisa faele ea tlhomamiso ka tsela efe kapa efe e loketseng/boot/grub/grub.conf. Fetola litaba tsa eona e le hore mekhahlelo e latelang e be le litekanyetso tse nepahetseng:

default = 0
nakoout = 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 = hcc xencons = tty0 root = / dev / xvda1 ro
initrd /boot/initramfs-4.0.4-1.el7.elrepo.x86_64.img

Ebe o tlameha ho qala setera se inehetseng mme o tsoele pele ho kenngoa ha seva sa FTP khomphuteng.

Mohato oa bobeli: Tlhophiso ea pele ea Seva sa FTP

Hammoho le lenaneo lena, file ea eona e lokiselitsoeng e ne e kenngoa ka khomphuteng, ho tloha moo seva sa FTP se sebetsang teng. Litlhophiso tsohle li entsoe ka ho toba ka bomong ho litlhahiso tsa ho amohela kapa ho rata lithahasello tsa bona. Re ka bonts'a feela hore na file ena e buletsoe joang le hore na ke lintlha life tse lokelang ho ela hloko.

  1. Ka mekhoa ea ts'ebetso ea Debian kapa ea Ubuntu, faele ea setšoantšo e sebetsa joaloka ena:sudo nano /etc/vsftpd.conf. Ka CentOS le Fedora ho tseleng./etc/vsftpd/vsftpd.conf, le Gentoo -/etc/vsftpd/vsftpd.conf.example.
  2. Fifa ka boeona e bonts'oa ho console kapa mohlophisi oa mongolo. Mona ela hloko lintlha tse ka tlase. Ka faele ea hau ea tlhophiso, ba lokela ho ba le litekanyetso tse tšoanang.

    sa tsejoe_enable = HA
    local_enable = EGO
    ngola_enable = EGO
    chroot_local_user = EGO

  3. Etsa phomolo kaofela ho itlhophisa, ebe u se ke ua lebala ho boloka liphetoho.

Mohato oa 3: Ho eketsa Mofuthu o Molemo

Haeba u il'o sebetsa le seva sa FTP eseng ka akhaonto ea hau e kholo kapa u batla ho fa basebelisi ba bang monyetla oa ho fumana, litlaleho tse bōpiloeng li tlameha ho ba le litokelo tsa bosholu e le hore ha u ka fumana thuso ea VSftpd ha ho na liphoso tse nang le phihlelo e hanetsoeng.

  1. Matha "Terminal" 'me u kene taelosudo adduser user1moo user1 - lebitso la akhaonto e ncha.
  2. Beha phasewete bakeng sa eona, ebe ue netefatsa. Ho phaella moo, re khothaletsa ka tieo hore re hopole tlaleho ea lehae ea akhaonto, nakong e tlang u ka 'na ua hloka ho e fihlela ka console.
  3. Tlatsa tlhahisoleseding ea motheo-lebitso le tletseng, nomoro ea kamore, linomoro tsa fono le boitsebiso bo bong, ha ho hlokahala.
  4. Ka mor'a moo, fa motho ea sebelisang litokelo tse atolositsoeng ka ho kenya taelosudo adduser user1 sudo.
  5. Etsa bakeng sa mofani sesebelisoa se fapaneng bakeng sa ho boloka lifaele tsa haesudo mkdir / home / user1 / lifaele.
  6. Ka mor'a moo, fallela fenseteng ea hau ea lehaecd / homemme moo o etsa hore mosebedisi e mocha e be mong'a hau ya hao ka ho thapamotsoako o khethiloeng: motso / lapeng / user1.
  7. Qala hape seva ka mor'a ho etsa liphetoho tsohle.sudo service vsftpd qala. Ke feela tlhahisong ea Gentoo, thuso e khutlisetsoang hape/etc/init.d/vsftpd e qala hape.

Hona joale o ka etsa liketso tsohle tse hlokahalang ho seva sa FTP molemong oa mocha e mocha ea atolositseng litokelo tsa ho kena.

Mohato oa 4: Lokisa Firewall (Botho feela)

Basebelisi ba liphallelo tse ling ba ka qoba mohato ona ka mokhoa o sireletsehileng, kaha kopo ea port ha e hlokehe kae kapa kae, feela ho Ubuntu. Ka nako e telele, Firewall e lokiselitsoe ka tsela e ke keng ea lumella tšebetso e kenang ho tloha liaterese tseo re li hlokang, ka hona, re tla hloka ho lumella temana ea eona ka letsoho.

  1. Ka khomphuteng, etsa hore litaelo tsena li behoe ka bonngoe.sudo ufw e thibeletselesudo ufw thusaho qala setsi sa mollo oa mollo.
  2. Kenya melao e sa hlahang e sebelisasudo ufw lumella 20 / tcplesudo ufw lumella 21 / tcp.
  3. Hlahloba hore na melao e sebelisitsoe ka ho sheba boemo ba mollo oa molloho rata boemo.

Ka thōko, ke batla ho bua ka litaelo tse 'maloa tsa bohlokoa:

  • /etc/init.d/vsftpd qalakapatšebeletso vsftpd qala- ts'ebetso ea faele ea tlhomamiso;
  • netstat -tanp | grep MAMELA- ho hlahloba ho nepahala ha ho kenya seva sa FTP;
  • man vsftpd- bitsa litokomane tsa VSftpd tsa molao ho batla boitsebiso bo hlokahalang mabapi le ts'ebetsong ea thuso;
  • tšebeletso vsftpd qala hapekapa/etc/init.d/vsftpd e qala hape- sebedisa sebopeho.

Mabapi le ho fihlella ho seva-FTP mme o tsoela pele ho sebetsa le eona, ikopanya bakeng sa ho amohela lintlha tsena ho baemeli ba ho amohela ha hao. Ho bona, o tla khona ho hlakisa tlhahisoleseling mabapi le ho pata ha maemo le ho hlaha ha mefuta e sa tšoaneng ea liphoso.

Sehlooho sena sea fela. Kajeno re hlahlobile ts'ebetso ea ho kenngoa ha seva sa VSftpd ntle le ho kopanngoa le k'hamphani leha e le efe ea ho khothaletsa batho, kahoo e lule u hopotse sena ha u phetha litaelo tsa rona le ho li bapisa le tse fanoang ke k'hamphani e nang le seva sa hau sa sebele. Ho phaella moo, re u eletsa hore u itlhalose ka boitsebiso ba rona bo bong, bo sebetsanang le sehlooho sa tlhomamiso ea LAMP likaroloana.

Bona hape: Ho kenya LAMP suite ho Ubuntu