Cov txheej txheem:

Ruaj Ntseg Nkag Mus Rau Koj Tus Pi Los Ntawm Txhua Qhov Chaw Hauv Ntiaj Teb: 7 Kauj Ruam
Ruaj Ntseg Nkag Mus Rau Koj Tus Pi Los Ntawm Txhua Qhov Chaw Hauv Ntiaj Teb: 7 Kauj Ruam

Video: Ruaj Ntseg Nkag Mus Rau Koj Tus Pi Los Ntawm Txhua Qhov Chaw Hauv Ntiaj Teb: 7 Kauj Ruam

Video: Ruaj Ntseg Nkag Mus Rau Koj Tus Pi Los Ntawm Txhua Qhov Chaw Hauv Ntiaj Teb: 7 Kauj Ruam
Video: [Hmong Vietsub] Kuv Puas Nyob Hauv Koj Lub Siab - (Laj Tsawb) 把你藏在我心里 - (邹兴兰) 2024, Hlis ntuj nqeg
Anonim
Ruaj Ntseg Nkag Mus Rau Koj Tus Pi Los Ntawm Txhua Qhov Chaw Hauv Ntiaj Teb
Ruaj Ntseg Nkag Mus Rau Koj Tus Pi Los Ntawm Txhua Qhov Chaw Hauv Ntiaj Teb

Kuv muaj ob peb daim ntawv thov khiav ncig lub moos ntawm Pi. Thaum twg los kuv tau tawm ntawm kuv lub tsev, nws nyuaj heev los tshuaj xyuas tus Pi txoj kev noj qab haus huv thiab xwm txheej. Tom qab kuv tau kov yeej qhov teeb meem me me uas siv ngrok. Kev nkag mus rau lub cuab yeej los ntawm sab nraud ua rau muaj lus nug txog kev nyab xeeb uas kuv tau ua los ntawm kev ua kom tau 2FA (2 qhov kev lees paub qhov tseeb) lossis 2 kauj ruam ua pov thawj. Yog li ntawm no yog cov theem hauv qab no rau koj kom nkag mus rau koj Pi los ntawm sab nraud nrog txheej ntxiv ntawm kev ruaj ntseg.

Kauj ruam 1: Video Qhia

Image
Image

Qee tus nyiam sau cov ntaub ntawv thiab qee cov vis dis aus qhia. Yog tias koj yog ib tus ntawm ntau leej uas nyiam cov vis dis aus qhia tawm cov vis dis aus no rau cov lus qhia ib qib zuj zus.

Kauj ruam 2: Npaj Ngrok

Qhib lub davhlau ya nyob twg ntawm koj Pi thiab khiav cov lus txib hauv qab no ib qho dhau ib qho los rub tawm thiab npaj ua daim ntawv thov ngrok

cd/tsev/pi/

wget "https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip"

sudo unzip ngrok-stable-linux-arm.zip

Tam sim no koj yuav tsum muaj daim nplaub tshev sau npe ngrok ntawm/home/pi/directory.

Xaiv tau, koj tuaj yeem tshem thawj daim ntawv rub tawm zip los khaws qee qhov chaw

sudo rm /home/pi/ngrok-stable-linux-arm.zip

Tam sim no tau txais cov ntaub ntawv ntxiv los pab koj teeb tsa ngrok ua haujlwm

git clone

Kauj ruam 3: Kauj ruam Ngrok

Kauj ruam
Kauj ruam
Kauj ruam
Kauj ruam

Lub taub hau mus rau ngrok lub vev xaib thiab nkag mus. Yog tias koj tsis muaj tus as khauj, sau npe rau ib tus.

Ntawm koj li ngrok dashboard thiab hauv qab daim ntawv lees paub, koj yuav tsum pom koj li Authtoken zoo li nws tau qhia hauv qab no.

Ntawm lub davhlau ya nyob twg ntawm koj li Raspberry Pi, khiav cov hauv qab no los teeb tsa koj lub suab hais lus.

/home/pi/ngrok authtoken "Koj AUTHTOKEN COPIED Los ntawm ngrok DASHBOARD"

Koj yuav tsum tau txais kev lees paub zoo li qhia hauv qab no.

Luam qhov av ntawm cov qauv ngrok teeb tsa cov ntaub ntawv (ngrok-sample.yml) hauv/home/pi/ngrok-service/folder.

Qhib lub default configuration file siv:

sudo nano /home/pi/.ngrok2/ngrok.yml

Muab tshuaj txhuam qhov uas koj nyuam qhuav theej los ntawm cov qauv. Xav tias tshem tawm lwm qhov av uas koj yuav tsis xav tau dua li SSH.

Tam sim no txheeb xyuas yog tias lub qhov av ua haujlwm los ntawm kev pib siv daim ntawv thov ngrok siv

/home/pi/ngrok pib -all

Kauj Ruam 4: Teeb Ngrok Raws Li Kev Pabcuam

Khiav cov lus txib ib qho dhau ib qho los teeb tsa ngrok ua kev pabcuam

sudo chmod +x /home/pi/ngrok-service/scripts/service-installer.sh

sudo /home/pi/ngrok-service/scripts/service-installer.sh

sudo systemctl pab ngrok.service

sudo systemctl pib ngrok.service

Ib ntus nres qhov kev pabcuam ngrok kom txog thaum ob qhov kev txheeb xyuas qhov tseeb teeb tsa tiav.

sudo systemctl nres ngrok.service

Kauj Ruam 5: Teeb Ob Qhov Tseeb Qhov Tseeb

Pab kom SSH yog tias tsis tau ua tiav siv:

sudo systemctl pab ssh

sudo systemctl pab ssh

sudo systemctl nres ssh

Pab kom muaj ob yam kev sib tw. Qhib ssh teeb tsa siv:

sudo nano/etc/ssh/sshd_config

Hloov ChallengeResponseAuthentication los ntawm lub neej ntawd tsis yog yog.

Txuag cov ntaub ntawv teeb tsa thiab tawm.

Kauj Ruam 6: Kho Google Authenticator

Nruab google pluggable google authentication module

sudo apt nruab libpam-google-authenticator

Khiav cov hauv qab no kom pib authentator module

google-authenticator

Rub tawm Google Cov Ntawv Pov Thawj Zoo ntawm koj lub xov tooj ntawm tes thiab txuas PAM tus lej los ntawm kev tshuaj xyuas QR code ntawm lub vijtsam.

Kho PAM ntxiv ob qhov kev txheeb xyuas qhov tseeb.

sudo nano /etc/pam.d/sshd

Ntxiv kab hauv qab no mus rau qhov pib

auth yuav tsum pam_google_authenticator.so

Qhov no tuaj yeem ntxiv hauv qab no lossis siab dua @include common-auth

Kauj Ruam 7: Rov Pib Ssh thiab Ngrok

Rov pib dua cov kev pabcuam

sudo systemctl rov pib dua ssh

sudo systemctl rov pib dua ngrok.service

Thiab qhov ntawd yog qhwv

Pom zoo: