Yuav Tso Tus Password Li Cas Hauv Lub Xaib

Cov txheej txheem:

Yuav Tso Tus Password Li Cas Hauv Lub Xaib
Yuav Tso Tus Password Li Cas Hauv Lub Xaib

Video: Yuav Tso Tus Password Li Cas Hauv Lub Xaib

Video: Yuav Tso Tus Password Li Cas Hauv Lub Xaib
Video: Qhia nkag qub facebook thaum yus tsis nco qab password 2024, Kaum ib hlis
Anonim

Qee zaum nws yuav tsim nyog rau lo lus zais tiv thaiv nkag mus rau tag nrho cov nplooj ntawv ntawm lub xaib lossis tsuas yog rau qee qhov chaw ntawm nws. Tus txheej txheem rau kev tso cai rau cov neeg tuaj saib nkag tau cov nplooj ntawv los ntawm kev nkag mus thiab password yog hu ua "kev tso cai". Yuav ua li cas npaj cov ntawv tso cai yam tsis muaj kev paub txog ntawm cov lus programming?

HT TSEEM CEEB: Yuav ua li cas muab tus password rau lub vev xaib
HT TSEEM CEEB: Yuav ua li cas muab tus password rau lub vev xaib

Cov Lus Qhia

Kauj ruam 1

Qhov yooj yim los thaiv kev nkag mus rau lub xaib nrog tus password yog siv cov cuab yeej tsim muaj ntawm lub vev xaib uas tuav lub xaib. Apache server chaw teeb tsa yog qhov ntawd yog tias muaj cov ntaub ntawv npe hu ua ".htaccess" hauv txhua tus neeg rau zaub mov, tom qab ntawd thaum thov daim ntawv los ntawm cov ntawv no (piv txwv li, lub vev xaib), Apache yuav ua raws cov cai uas muaj nyob hauv.htaccess. Cov ntaub ntawv no tseem tuaj yeem muaj cov lus qhia txhawm rau txwv kev nkag mus rau tag nrho lossis qee cov ntaub ntawv hauv daim nplaub tshev no. Peb yuav siv cov txheej txheem no. Kauj ruam 1: Tsim cov ntawv.htaccess Qhov yooj yim txoj kev los tsim cov ntawv npliag npe hu ua.htaccess nyob hauv cov ntawv nyeem ib txwm siv - Notepad. Yog li ntawd thaum khaws cov ntaub ntawv, notepad tsis cia li ntxiv txt qhov txuas ntxiv, hauv "hom ntawv" cov ntawv teev cia ntawm cov ntawv khaws tseg, xaiv "Txhua cov ntaub ntawv" Cov lus qhia uas yuav tsum tau sau hauv.htaccess yuav zoo li qhov no: AuthType Basic

AuthName "Txwv tsis pub cheeb tsam!"

AuthUserFile /usr/host/mysite/.htpasswd

xav kom siv tau-siv Thawj kab ntawv (AuthType Basic) qhia tus neeg rau zaub mov tias yuav tsum tau kev tso cai ntawm cov neeg tuaj saib. Thib ob (AuthName "Forbidden zone!") tshwj xeeb tshaj yog cov lus sau rau ntawm tus ID nkag mus thiab tus password nkag rau daim ntawv thij peb (AuthUserFile /usr/host/mysite/.htpasswd) qhia txoj hauv kev uas cov ntawv tso cai nkag thiab password raug khaws cia. "Txoj hauv kev" yuav tsum tau qhia ntawm no, uas yog, los ntawm cov neeg rau zaub mov hauv paus phau ntawv nws tus kheej, taw qhia tag nrho cov ntoo hauv lub npe. Qhov no yog tib txoj kab uas peb pom hauv qhov chaw nyob ntawm Windows Explorer thaum peb qhib daim nplaub tshev. Ntawm lub vev xaib hosting servers, nws feem ntau zoo li /pub/home/account_name/…/file_name. Txoj kev los ntawm cov neeg rau zaub mov hauv paus rau koj lub xaib tuaj yeem pom nyob hauv lub xaib tswj hwm chaw lossis los ntawm kev thov kev txhawb nqa ntawm koj lub hosting. Koj tuaj yeem pom ntawm koj tus kheej, tab sis qhov no yuav xav tau siv qee qhov kev sau ua lus - piv txwv li, hauv PHP nws tuaj yeem tau los ntawm cov txiaj ntsig ntawm phpinfo () hais txog kab plaub (xav kom siv tau) txhais tau tias tsis muaj dab tsi tab sis kev nkag mus rau tus username thiab password kom siv tau cov ntaub ntawv hauv phau ntawv teev npe no tsis tas yuav siv. Qhov tseeb, koj tuaj yeem faib cov qhua rau hauv pab pawg, thiab muab cov pab pawg sib txawv nyias muaj cai nkag mus rau nyias cov folders.

Kauj ruam 2

Kauj ruam 2: Tsim cov ntaub ntawv.htpasswd Tam sim no koj yuav tsum tsim cov ntawv zais (password), txoj hauv kev uas peb tau teev tseg hauv htaccess. Los ntawm lub neej ntawd, nws tau muab lub npe ".htpasswd", txawm hais tias qhov no tsis tas yuav - koj tuaj yeem hais lwm lub npe. Cov ntaub ntawv no khaws tus ID nkag mus-lo lus zais khub, thiab tus password nyob hauv ib qho kev pub nkag. Txhawm rau nkag lo lus zais, koj yuav tsum tau siv cov haujlwm tshwj xeeb - htpasswd.exe. Yog tias koj tsis muaj Apache server nruab rau hauv koj lub computer, tom qab ntawd koj tuaj yeem nqa nws, piv txwv li, ntawm no - https://www.intrex.net/techsupp/htpasswd.exe. Koj yuav tsum khiav nws ntawm kab hais kom ua. Hauv Windows XP, kuv ua qhov no: muab htpasswd.exe rau hauv daim nplaub tshev cais, nyem rau ntawm daim nplaub tshev thiab xaiv "Run command line nov" los ntawm cov ntawv qhia zaub mov. Ntawm kab hais kom ua, ntaus: htpasswd-cm.htpasswd admin Ntawm no

htpasswd yog lub npe ntawm qhov kev pab cuam;

-cm yog kev hloov kho uas qhia tau tias tsim tus password tshiab yuav tsum tau tsim;

.htpasswd yog lub npe rau cov ntaub ntawv tshiab no;

admin yog tus ID nkag mus ntawm thawj tus neeg siv yuav tsum tau ntxiv rau hauv cov ntaub ntawv. Thaum tom qab nias Enter, koj yuav raug qhia kom nkag mus thiab rov ua dua tus password rau tus neeg siv no. Thaum tus password nkag mus thiab paub tseeb,.htpasswd ntawv peb xav tau yuav tsim nyob rau hauv daim nplaub tshev nrog ib tus username - password khub. Txhawm rau ntxiv ntau cov neeg siv, koj yuav tsum khiav htpasswd.exe dua, tab sis hloov ntawm -cm hloov kho, qhia kom meej tsuas -m. Koj tseem tuaj yeem pom kev pab ntawm cov kab hais kom ua. ntawm htpasswd.exe - rau qhov no koj yuav tsum ntaus: htpasswd.exe /?

Khiav cov kab hais kom ua
Khiav cov kab hais kom ua

Kauj ruam 3

Kauj ruam 3: muab cov ntaub ntawv xa mus rau tus neeg rau zaub mov. Txhua yam uas tseem tshuav yog muab ob qho chaw tsim ntawv (.htaccess thiab.htpasswd) rau ntawm lub server. Qhov no tuaj yeem ua tiav nrog txhua tus neeg siv ftp lossis los ntawm tus tuav cov ntaub ntawv hauv cov thawj coj ntawm koj lub xaib. Htaccess cov ntaub ntawv muab tso rau hauv daim nplaub tshev uas cov nplooj ntawv uas koj xav tau kev tiv thaiv (password) khaws cia. Tsis yog cov ntaub ntawv ntawm daim nplaub tshev no xwb, yuav tiv thaiv tau, tab sis txhua daim nplaub tshev hauv nws. Thiab muab cov ntawv.htpasswd rau hauv daim nplaub tshev, txoj hauv kev uas tau teev tseg hauv htaccess. Feem ntau, cov ntawv zais (password) khaws cia rau hauv cov ntawv tais ceev tseg ib theem siab dua cov cag npe ntawm lub xaib kom tsis muaj qhov nkag ncaj qha rau nws los ntawm Is Taws Nem.

Pom zoo: