Abuuritaanka server-ka FTP ee Linux

Wareejinta faylasha ee shabakada waxaa lagu fuliyaa iyadoo loo marayo server-ka FTP-da habaysan. Nidaamkani wuxuu ka shaqeeyaa isticmaalka naqshadeynta adeegga macaamiisha TCP wuxuuna isticmaalaa isku xirnaanta shabakadaha kala duwan si loo hubiyo kala wareejinta amarrada u dhexeeya noodhka xiran Isticmaalayaasha ku xiran shirkad gaar ah oo martigelinaysa waxay la kulantaa baahida loo qabo in la sameeyo macaamiisha FTP-ga shakhsi ahaaneed iyada oo loo eegayo shuruudaha shirkadda bixisa adeegyada dayactirka bogga ama software kale. Next, waxaan soo bandhigi doonaa sida loo abuuro server noocan oo kale ah Linux iyadoo la adeegsanayo tusaale ahaan mid ka mid ah adeegyada.

Abuur server-ka FTP ee Linux

Maanta waxaan isticmaali doonaa qalab la yiraahdo VSftpd. Faa'iidooyinka ka mid ah server-ka FTP-ga ayaa ah middaas oo ay ku socoto nidaamyo fara badan oo ka shaqeynaya, waxay ilaalineysaa rasmiga rasmiga ah ee qaybinta Linux-yada iyo si fudud u-rakibidda hawlgal haboon. By habka, FTP this gaar ah waxaa si rasmi ah loo isticmaalaa kernel Linux, iyo shirkado badan martigalinta ku talinaynaa rakibidda VSftpd. Sidaa daraadeed, aan u fiirsano geeddi-socodka tallaabo tallaabo ah oo lagu rakibayo loona habaynayo qaybaha muhiimka ah.

Talaabada 1aad: Ku rakib VSftpd

Badbaadada, dhammaan maktabadaha muhiimka ah ee VSftpd ee aan la heli karin, sidaas darteed waa in loo dhiibaa gacanta casriga. Tan waxaa loo sameeyaa sida soo socota:

  1. Furo "Terminal" hab kasta oo habboon, tusaale ahaan, iyada oo loo marayo menu.
  2. Holders of Debian ama Ubuntu loo baahan yahay in la diiwaangeliyo amar.sudo apt-get install vsftpd. CentOS, Fedora -yum rakibo vsftpd, iyo Gentoo -waxay soo baxaysaa vsftpd. Kadib markaad hordhigto, guji Galisi aad u bilowdo habka rakibida.
  3. Xaqiiji in aad xaq u leedahay koontadaada adigoo ku qeexaya furaha saxda ah.
  4. Sug sugida faylal cusub oo lagu daro nidaamka.

Waxaan soo jiidnaa dareenka milkiilayaasha CentOS, oo isticmaalaya server-yada farsameysan ee laga soo qaato marti-gelinta. Waxaad u baahan doontaa inaad cusboonaysiiso nidaamka OS-kernel, sababtoo ah iyada oo aan nidaamkan, qalad halis ah ayaa la arki doonaa inta lagu jiro rakibidda. Si guul leh u gali amarrada soo socda:

cusboonaysiinta
rpm -Uvh //www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum rakibo 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 rakibo kernel-ml-3.15.6-1.el7.elrepo.x86_64.rpm
wget http://mirrors.neterra.net/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-devel-3.15.6-1.el7.elrepo.x86_64.rpm
yum rakibo kernel-ml-devel-3.15.6-1.el7.elrepo.x86_64.rpm
wget http://mirrors.neterra.net/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-doc-3.15.6-1.el7.elrepo.noarch.rpm
yum rakibo 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 rakibo kernel-ml-madax-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 rakibida qalabka xawaaraha-ml-qalabka-libs-3.15.6-1.el7.elrepo.x86_64.rpm
yum rakibo kernel-ml-qalab-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 rakibo qalabka xawaaraha-ml-qalab-libs-devel-3.15.6-1.el7.elrepo.x86_64.rpm
wget http://mirrors.neterra.net/elrepo/kernel/el7/x86_64/RPMS/perf-3.15.6-1.el7.elrepo.x86_64.rpm
yum rakibo perf-3.15.6-1.el7.elrepo.x86_64.rpm
wget http://mirrors.neterra.net/elrepo/kernel/el7/x86_64/RPMS/python-perf-3.15.6-1.el7.elrepo.x86_64.rpm
yum rakibo python-perf-3.15.6-1.el7.elrepo.x86_64.rpm
yum --enablerepo = elrepo-kernel rakibo kernel-ml

Kadib dhammaadka nidaamkan oo idil, u gudbi faylka qaabka qaabka haboon./boot/grub/grub.conf. Beddel ujeeddadeeda si ay xuduudaha soo socdaa u leeyihiin qiimaha ku haboon:

default = 0
timeout = 5
magaca vmlinuz-4.0.4-1.el7.elrepo.x86_64
xidid (hd0.0)
kernel /boot/vmlinuz-4.0.4-1.el7.elrepo.x86_64 konsole = hvc0 xencons = tty0 root = / dev / xvda1 ro
initrd /boot/initramfs-4.0.4-1.el7.elrepo.x86_64.img

Ka dibna kaliya waa inaad ku soo noqotaa server-ga loo yaqaan "dedicated server" ka dibna u sii gudubka kombiyutarka FTP ee kombuyuutarka.

Tallaabada 2aad: Qalabka FTP Server ee bilowga ah

Iyadoo la socota barnaamijka, faylka habka loo qaabeeyey ayaa lagu soo rogay kombiyuutarka, laga bilaabo kaas oo ka shaqeeya server FTP. Dhammaan goobaha waxaa si gaar ah loogu sameeyaa talooyinka martigelinta ama doorbidooda. Waxaan tusi karnaa oo keliya sida faylka loo furay iyo wixii xaddidaad ah ee loo baahan yahay in la bixiyo.

  1. On nidaamka socodsiinta Debian ama Ubuntu, faylka habka qaabeynta ayaa sidaan sidan oo kale:sudo nano /etc/vsftpd.conf. In CentOS iyo Fedora waa jidka./etc/vsftpd/vsftpd.conf, iyo Gentoo -/etc/vsftpd/vsftpd.conf.example.
  2. Faylka laftiisa ayaa lagu soo bandhigaa qunsulka ama tifaftiraha qoraalka. Halkan fiiri qodobada hoose. Faylka qaabeynta qaabka, waa inay lahaadaan qiime isku mid ah.

    anonymous_enable = MAYA
    local_enable = HAA
    write_enable = HAA
    chroot_local_user = HAA

  3. Inta kale naftaada iskuday, ka dibna ha ilaawin inaad badbaadiso isbedelada.

Talaabada 3aad: Ku-kordhinta Isticmaalaha Horukacsan

Haddii aad doonayso in aad la shaqeyso adeegsade FTP ah oo aan kuugu soo marin xisaabtaada ugu weyn ama aad rabto inaad siiso isticmaale kale kuwa kale, profiles ayaa abuuray xuquuqda superuser si markaa helitaanka adeegga VSftpd ma jiraan wax khalad ah oo la heley.

  1. Orod "Terminal" oo qaynuunnada xajiyasudo adduser user1meesha user1 - magaca koontada cusub.
  2. Sameey sirta, kadibna ku adkee. Intaa waxaa dheer, waxaan si xoog leh kugula talineynaa in aad xusuusatid diiwaanka guriga ee koontada, mustaqbalka waxaad u baahan kartaa in aad ku soo gasho qunsulka.
  3. Buuxi macluumaadka aasaasiga ah - Magaca buuxa, lambarka qolka, lambarada telefoonka iyo macluumaadka kale, haddii loo baahdo.
  4. Ka dib markaa, u ogolow xuquuqda dheeraadka ah ee isticmaalaha adoo gelaya amarkasudo adduser user1 sudo.
  5. Samee qofka isticmaalaya buug gooni ah si uu u kaydiyo feylihiisasudo mkdir / guriga / user1 / faylasha.
  6. Marka xigta, u gudub qaybtaada gurigaagaCd / gurigaoo halkaa ka samee isticmaalaha cusub ee mulkiilahaaga liiska adigoo qorayaXiddigta la xidho: asalka / guriga / user1.
  7. Kusiiji server ka dib markaad sameyso isbedel kasta.sudo service vsftpd dib u bilow. Kaliya qaybinta Gentoo, korontada ayaa dib loo soo celiyaa/etc/init.d/vsftpd Dib u bilow.

Hadda waxaad samayn kartaa dhamaan tallaabooyinka lagama maarmaanka ah ee loo yaqaano FTP ka wakiil ah adeegsade cusub oo kordhiyay xuquuqda helitaanka.

Talaabada 4: Qalabaynta Damiinka (Ubuntu oo kaliya)

Isticmaalayaasha kale ee qaybinta ayaa si ammaan ah uga boodi kara tallaabadan, maaddaama naqshadeynta dekeddu aanay u baahnayn meel kasta, kaliya Ubuntu. Marka la eego, dukumiintiga waxaa loo qaabeeyey si habaysan oo aan u oggolaan doonin gaadiidka soo galaya cinwaannada aan ubaahanahay, sidaas darteed, waxaan u baahan doonaa inaan u oggolaano in ay maraan manhajka.

  1. Masruufka, ku dhaqal amarrada hal mid.sudo ufw disableiyosudo ufw awoodsi aad u bilawdo dab-demiska.
  2. Ku dar qawaaniinta soo galaya ee isticmaalayasudo ufw ogolaan 20 / tcpiyosudo ufw ogolaan 21 / tcp.
  3. Iska hubi haddii sharciyada la adeegsaday ayadoo la eegayo xaaladda duurjoogtasudo ufw xaalada.

Dhanka kale, waxaan rabaa in aan xuso amarro dhowr ah oo faa'iido leh:

  • /etc/init.d/vsftpd bilawgaamabilowga bilowga adeegga bilaashka ah- falanqaynta faylka qaabeynta;
  • netstat -tap | GOOBTA LAMBAR- hubinta saxsanaanta rakibidda server-ka FTP;
  • man vsftpd- wac dokumentiyada rasmiga ah ee VSftpd si aad u raadiso macluumaadka lagama maarmaanka ah ee ku saabsan hawlgalka korontada;
  • adeega bilaashka ah ee bakhtiyaa nasiibkaama/etc/init.d/vsftpd Dib u bilow- Sameeyaha dib u bilaabista.

Marka la eego helitaanka FTP-server-ka iyo sii wado shaqo dheeraad ah, la xiriir si aad u hesho macluumaadkaan wakiillada martigelinta. Laga soo bilaabo iyaga, waxaad awood u yeelan doontaa inaad caddeeysid macluumaadka kusaabsan munaasabadaha hagaajinta iyo dhacdooyinka noocyada kala duwan ee qaladaadka.

Maqaalkani wuxuu ku dhamaanayaa dhamaadka. Maanta waxaan ku falanqeynay nidaamka rakibidda ee server VSftpd iyada oo aan loo xirin shirkad martigelineysa, markaa maskaxda ku hay markaad fulinayso tilmaamahayaga oo aan isbarbardhigo kuwa ay bixiso shirkadda oo ay ku jirto adeeggaaga wanaajinta. Intaa waxaa dheer, waxaanu kugula talinaynaa in aad barato waxyaalahayaga kale, kaas oo ka hadlaya mowduuca ku-meelgaarka ee qaybaha LAMP.

Sidoo kale fiiri: Ku rakibida suunka LAMP ee Ubuntu