Lawe ʻia ka faila i ka pūnaewele i ʻike ʻia i kahi kikowaena FTP hoʻonohonoho pono pono ʻia. Hana ʻia kēlā mau protocol me ka hoʻohana ʻana i TCP ma ka papa kuhikuhi o kahi mea kūʻai pūnaewele a hoʻohana i nā pili ʻoihana like ʻole e hōʻoia i ka neʻe ʻana o nā kauoha ma waena o nā nū pili. ʻO nā mea hoʻohana i pili i kahi kikowaena kūikawā e hoʻohālikelike ʻia me ka pono e hoʻonohonoho i kahi kikowaena FTP pilikino e like me ke koi ʻana o kahi hui e hāʻawi ana i ka lawelawe mālama pūnaewele a i ʻole nā polokalamu ʻē aʻe ʻO ka aʻe, e hōʻike mākou pehea e hana ai i kēia server i Linux e hoʻohana ana i kekahi o nā pono hana ma ke ʻano he kumu hoʻohālike.
E hoʻokumu i kahi kikowaena FTP ma Linux
I kēia lā e hoʻohana mākou i kahi mea i kapa ʻia ʻo VSftpd. ʻO nā pono o ia kikowaena FTP, ke holo nei ia ma luna o nā ʻōnaehana hana ma ke ʻano, ma ka waiho ʻana i nā repository kūhelu o nā kaapuni Linux ʻē aʻe, a he mea maʻalahi ke hoʻoponopono no ka hana pono. Ma ke ala, hoʻohana maʻamau ʻia kēia FTP ma ka Linux kernel, a ua noi nui nā hui lawelawe e kau iā VSftpd. No laila, e makaʻala mākou i ke nānā i ke ala i ke ala a me ka hoʻonohonoho o nā mea i pono.
Ka ʻAkuhi 1: Hoʻopili i ka VSftpd
Ma ka maʻamau, ʻaʻole i hoʻokomo ʻia nā waihona puke VSftpd pono i nā puʻupuʻu, no laila, pono ʻoe e hoʻihoʻi lima iā lākou ma o ka console. Hoʻ lawe ʻia aku ia penei:
- Wehe "Aloha" kekahi ʻano hana kūpono, no ka laʻana, ma o ka papa.
- Pono nā mea nona nā palapala Debian a i ʻole Ubuntu e kākau inoa i kahi kauoha
sudo apt-pono c hookuu vsftpd
. ^ E Ha yM. PONOSI, Fedora -yum install vsftpd
, a no Gentoo -hoʻokipa vsftpd
. ^ E Ha yM. Ma hope o ka hoʻomaka ʻana, kaomi Kāheae hoʻomaka i ka kaʻina hoʻonohonoho. - E hōʻoia i kāu moʻokāki me ka ʻōlelo huna kūpono.
- E kali no ka hoʻopau ʻana o ka hoʻohui ʻana i nā faila hou i ka ʻōnaehana.
Manaʻo mākou i ka makaʻo o nā mea nona ka CentOS e hoʻohana i kahi kikowaena pūnaewele hoʻokaʻawale mai kahi lawelawe. Pono ʻoe e hōʻano hou i ka module kernel OS, no ka mea ʻole o kēia kaʻina hana e loaʻa kekahi hewa hewa i ka wā o ka hoʻonohonoho. Hoʻopili i nā ʻōmole penei:
yum update
rpm -Uvh //www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum install yum-plugin-wikiwikimirror
wget //mirrors.neterra.net/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-3.15.6-1.el7.elrepo.x86_64.rpm
yum install 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 install 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 install 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 install 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 install kernel-ml-tool-libs-3.15.6-1.el7.elrepo.x86_64.rpm
yum install kernel-ml-pono-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 install kernel-ml-tool-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 install 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 install python-perf-3.15.6-1.el7.elrepo.x86_64.rpm
yum --enablerepo = elrepo-kernel install kernel-ml
Ma hope o ka hoʻopau ʻana i kēia kaʻina hana, holo i ka faila hoʻonohonoho ma kekahi ala kūpono./boot/grub/grub.conf
. ^ E Ha yM. E hoʻololi i nā ʻike i ia mau mea i ka hopena i loaʻa nā waiwai kūpono:
paʻakau = 0
Kau manawa = 5
inoa vmlinuz-4.0.4-1.el7.elrepo.x86_64
aʻa (hd0.0)
kernel /boot/vmlinuz-4.0.4-1.el7.elrepo.x86_64 console = hvc0 xencons = tty0 aa = / dev / xvda1 ro
initrd /boot/initramfs-4.0.4-1.el7.elrepo.x86_64.img
A laila e hoʻoponopono hou i kāu kikowaena i hoʻolaʻa a hoʻomau i ka hoʻonohonoho pololei ʻana o ka server FTP i ka kamepiula.
KaʻAnuʻu 2: Hoʻomumu Pūnaewele FTP Pūnaewele
Me ka papahana, lawe ʻia kāna faila waihona i ke kamepiula, e hoʻomaka ana mai i ka mana o ke kikowaena FTP. Ke hana ʻia nei nā pae āpau e like me nā ʻōlelo a ka hoʻokolohua a i ʻole kāu makemake. Hiki iā mākou ke hōʻike wale ʻia pehea e wehe ʻia kēia faila a me nā mea e nānā ai e nānā.
- Ma nā pūnaehana hana ʻo Debian a i ʻole Ubuntu, holo ka faila hoʻonohonoho like me kēia:
sudo nano /etc/vsftpd.conf
. ^ E Ha yM. Ma CentOS a me Fedora, aia nō ia/etc/vsftpd/vsftpd.conf
a i Kauahi -/etc/vsftpd/vsftpd.conf.example
. - Hōʻike ʻia ka waihona ma ka console a i ʻole ka hoʻoponopono ʻōlelo. E ʻoluʻolu e ʻike i nā kuhihewa ma lalo. I kāu faila hoʻonohonoho, pono iā lākou nā mea like.
anonymous_enable = ʻole
local_enable = ʻĀ
kakau_enable = ʻES
chroot_local_user = ʻES - Hana i ke koena o ka hoʻoponopono o ʻoe, a ma hope o kēlā, mai poina e hoʻopakele i nā loli.
KaʻAnuʻu 3: Hoʻohui hou i kahi mea hoʻohana koʻikoʻi
Inā ʻaʻole ʻoe e hele pū me ka server FTP ma o kāu waihona nui a makemake paha e hāʻawi i ke komo ʻana i nā mea hoʻohana ʻē aʻe, pono nā mana o ka mea i haku ʻia no laila ke komo ʻana i ka polokalamu VSftpd ʻaʻole e hoʻoiho i nā hewa i hōʻole ʻia.
- Holo "Aloha" a komo i ke kauoha
sudo adduser user1
ma hea mea hoʻohana1 - ʻO ka inoa o ka moʻolelo hou. - E hoʻonohonoho i ka ʻōlelo huna no ia, a laila hōʻoia. Eia kekahi, manaʻo ikaika mākou e hoʻomanaʻo ʻoe i ka papa kuhikuhi o ka home ma ka moʻolelo; i ka wā e hiki mai ana, pono paha ʻoe e komo ma ka console.
- E hoʻopihapiha i nā ʻike maʻamau - ka inoa piha, ka helu lumi, nā helu kelepona a me nā ʻike ʻē aʻe, inā e koi ʻia.
- Ma hope o kēlā, e hāʻawi i ka pono i ka mea hoʻohana e ke komo ʻana i ke kauoha
sudo manuahi1
. - E hoʻokumu i kahi papa inoa kaʻawale no ka mea hoʻohana e mālama i kāna mau faila ma
sudo mkdir / home / user1 / faila
. - Next, neʻe i ka home home ma loko
cd / home
a ma laila e hana i ka mea hoʻohana hou ka mea nona kāu papa kuhikuhi ma ke kākau ʻanachown root: aʻa / home / user1
. - E hōʻano hou i ka server ma hope o ka loli ʻana i nā loli āpau
sudo lawelawe vsftpd hoʻomaka
. ^ E Ha yM. ʻO ka hoʻoili wale nō i ka Gentoo e hoʻomaʻa ai ka utility/etc/init.d/vsftpd i ʻole
.
I kēia manawa hiki iā ʻoe ke hana i nā hana pono a pau ma ka server FTP no ka mea hoʻohana hou i hoʻomaikaʻi i nā kuleana komo.
ʻLelo 4: E hōʻoia i ka Pōahi (Ubuntu wale nō)
Hiki i nā mea hoʻohana o nā hoʻoili ʻē aʻe ke kālele me kēia pae, no ka mea, ʻaʻole i koi ʻia ka hoʻonohonoho port ma nā wahi ʻē aʻe, aia wale nō ma Ubuntu. Ma ka hoʻopiʻi, e hoʻonohonoho paʻa ʻia ʻo Firewall i kēia ala ʻaʻole ia e ʻae aku i kahi kee komo mai nā wahī a mākou e pono ai, no laila, pono ʻoe e ʻae pololei i kona hele ʻana.
- I ka console, hoʻolaʻa i nā kauoha i kēlā me kēia
sudo kau uww disable
asudo ufw hiki
e hoʻomaka hou i kahiū ahi. - E hoʻohui i nā lula komo i ka hoʻohana ʻana
sudo ufw aee 20 / tcp
asudo ufw ae hiki ia 21 / tcp
. - E nānā inā ua hoʻokomo ʻia nā lula i hoʻokomo ʻia e ke nānā ʻana i ke kūlana ahi
sudo ufw kūlana
.
Hoʻokaʻawale, makemake wau e ʻike i kekahi mau ʻōlelo pono:
/etc/init.d/vsftpd hoʻomaka
a i ʻolehoʻomaka ʻo servicepftdd
- ka loiloi o ka faile hoʻonohonoho;netstat -tanp | grep OLELO
- ka hōʻoia i ka hoʻonohonoho ʻana o ka server FTP;kanaka vsftpd
- kāhea i ka palapala kūlana o VSftpd e loaʻa i ka ʻikepili pono e pili ana i ka hana o ke kōkana;lawelawe aftftd kū hou
a i ʻole/etc/init.d/vsftpd i ʻole
- hōʻano.
I ka loaʻa ʻana o ka ʻike ma kahi kikowaena FTP a hana hou me ia, e kāhea i kāu mau luna hoʻokele no ka loaʻa ʻana o kēia ʻike. Me lākou, hiki iā ʻoe ke wehewehe i ka ʻike e pili ana i nā subtleties o ke kani ʻana a me ke ala o nā ʻano like ʻole.
E pau kēia ʻatikala. I kēia lā ua nānā mākou i ke kaʻina no ka hoʻokomo ʻana i ka kikowaena VSftpd me ka ʻole e hoʻopili ʻia i kekahi hui hoʻokipa, no laila, e noʻonoʻo pono i kēia inā e hahai ana i kā mākou mau ʻōlelo a hoʻohālikelike ʻia iā lākou i hoʻolako ʻia e ka hui e pili ana i kāu kikowaena kikowaena. Eia kekahi, hōʻike mākou e hoʻomaʻamaʻa iā ʻoe iho me kā mākou mau mea e pono ai, i kūkākūkā e pili ana i ke kumuhana o ka hoʻokomo ʻana i nā māhele LAMP.
E ʻike pū: hoʻonoho pū i ka LAMP Software Suite ma Ubuntu