Cov txheej txheem:
- Kauj ruam 1: Nruab Raspbian
- Kauj Ruam 2: Nrhiav Raspberry Pi 2 hauv Koj Lub Network
- Kauj Ruam 3: Nruab YalerTunnel Daemon
- Kauj Ruam 4: Pib YalerTunnel Daemon
- Kauj Ruam 5: Nkag mus rau Raspberry Pi 2 Nrog rau SSH Client
Video: Tej thaj chaw deb SSH Nkag Mus Rau Raspberry Pi 2: 5 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:30
Puas tau xav xa Raspberry Pi "hauv thaj chaw" thiab tseem tuaj yeem nkag tau nws?
Nov yog txoj hauv kev yooj yim los pab kom SSH nyob deb nkag mus rau koj li Raspberry Pi 2 (thiab lwm yam qauv, ib yam nkaus). Thaum muaj cov kev daws teeb meem cuam tshuam nrog VPN lossis teeb tsa chaw nres nkoj xa mus ntawm lub firewall hauv zos, cov no feem ntau nyuaj rau kev tswj hwm rau cov tsis yog kws tshaj lij.
Ib tiam neeg tshiab ntawm cov kev pabcuam cuam tshuam nrog rau My-Devices.net, Pagekite.net thiab Yaler.net sim kho qhov no. Ntawm no peb siv Yaler xa cov kev pabcuam (nthuav tawm: Kuv yog tus tsim) muab SSH nkag los ntawm txhua qhov chaw mus rau Raspberry Pi 2.
Khoom siv
- Raspberry Pi 2 (lossis ib qho qauv), piv txwv li
- USB cable, A / Micro B, xws li
- Micro SD daim npav, 4 GB, piv txwv li
- Ethernet cable, piv txwv li
Tseem xav tau
- Desktop lossis laptop computer
- Network hauv zos nrog DHCP
(Nco tseg: Cov kauj ruam 3-5 raws li CC BY-SA Yaler qhia. Kauj ruam 1 & 2 cia koj pib ntawm kos.)
Kauj ruam 1: Nruab Raspbian
(Yog tias koj twb tau txais Raspbian khiav lawm, hla cov kauj ruam no.)
Rub daim duab
Cia peb siv Raspbian Jessie (Lite) duab uas muaj sshd khiav los ntawm lub neej ntawd. Qhov ntawd yog qhov ntxiv rau "tsis muaj taub hau" teeb tsa yam tsis muaj zaub, nas lossis keyboard.
- Tau txais cov duab Raspbian tsis ntev los no los ntawm https://www.raspberrypi.org/downloads/ lossis siv qhov txuas ncaj qha no.
- Unzip daim duab ZIP kom tau txais IMG cov ntaub ntawv duab
Npaj daim npav SD ntawm Mac OSX
Muaj ntau txoj hauv kev los npaj daim npav SD ntawm Mac. Nov yog qhov kuv nyiam:
- Tau txais PiFiller cov cuab yeej los ntawm https://ivanx.com/raspberrypi/ lossis siv qhov txuas ncaj qha no.
- Pib PiFiller thiab xaiv IMG cov duab rub tawm los saum toj no
Npaj SD daim npav ntawm Windows
- Tau Win32 Disk Imager los ntawm
- Pib lub cuab yeej thiab xaiv IMG rub tawm los saum toj no (ob zaug kuaj xyuas qhov tsav)
Npaj SD daim npav ntawm Linux
- Ua raws cov theem hauv
Siv daim npav SD
- Ntxig daim npav SD rau hauv Raspberry Pi 2
- Txuas lub ethernet cable rau koj lub network hauv zos
- Txuas lub USB cable los txuas lub cuab yeej thiab tos…
Ua tiav Tom qab ob peb feeb Raspbian yuav tsum tau nce.
Kauj Ruam 2: Nrhiav Raspberry Pi 2 hauv Koj Lub Network
(Yog tias Raspberry Pi 2 muaj zaub, nas thiab keyboard, hla cov kauj ruam no.)
Kuv Raspi nyob qhov twg?
Thaum Raspbian tau teeb tsa thiab Raspberry Pi 2 txuas nrog lub network hauv zej zog, nws yuav tsum tau txais tus IP chaw nyob nrog DHCP thiab pib khiav sshd, uas mloog SSH txuas txuas ntawm chaw nres nkoj 22. Tab sis IP yog dab tsi?
Cia peb saib
Ib txoj hauv kev kom pom IP chaw nyob ntawm Raspberry Pi 2 (thiab lwm yam khoom siv) yog siv nmap cov kab hais kom ua cuab yeej.
- Tau nmap los ntawm
- Kom tau txais koj lub khoos phis tawj IP chaw nyob, qhib lub davhlau ya nyob twg thiab hom
$ ifconfig
ua rau qee yam zoo li en0: chij =… 192.168.0.7 netmask…
- Pib nug nmap rau chaw nres nkoj 22 siv koj li IP chaw nyob ua ntej, piv txwv li
$ nmap 192.168.0.0-255 -p22
- Txheeb xyuas qhov tshwm sim (yog tias muaj ntau tus IPs, feem ntau nws yog qhov siab tshaj)
Xyuas kom nws yog koj li
- Tau txais SSH hauv zos nkag mus rau Raspberry Pi 2 nrog ssh, siv nws tus IP hauv zos, piv txwv.
$ ssh [email protected]
- Sau tus password, los ntawm lub neej ntawd nws yog raspberry
- Hloov tus password los ntawm kev ntaus ntawv
$ passwd
Ua tiav? Koj li Raspberry Pi 2 tam sim no tau npaj los txuas nrog cov kev pabcuam xa mus.
Kauj Ruam 3: Nruab YalerTunnel Daemon
Txheej txheem cej luam
YalerTunnel daemon yog software me me peb yuav muab tso rau hauv koj li Raspi txhawm rau txuas cov kev pabcuam hauv nroog uas khiav ntawm lub cuab yeej mus rau kev pabcuam sib txuas hauv huab. Zoo li no:
Cov Kev Pab Cuam Tshaj <- Firewall Local SSH Service
Tau txais kev tso npe
Txhua lub cuab yeej txuas nrog rau cov kev pabcuam xa xov xav tau kev tso npe nkag.
- Tau txais tus lej sim dawb suav nrog kev tso npe nkag ntawm
(Los yog, los tuav koj tus kheej kev xa xov rau kev siv tsis yog lag luam, saib
Nruab YalerTunnel
Cia peb tsim YalerTunnel daemon los ntawm qhov chaw.
- Qhib lub plhaub ntawm koj li Raspberry Pi 2 thiab hloov kho apt-tau nrog
$ sudo apt-tau hloov tshiab
- Rub tawm thiab teeb tsa libssl nrog
$ sudo apt-tau nruab libssl-dev
- Tsim cov npe yalertunnel
$ mkdir yalertunnel
$ cd yalertunnel
- Rub tawm, unzip thiab tsim YalerTunnel qhov chaw
$ wget
$ tar xfzmv YalerTunnel2.src.tar.gz $./configure && ua
Ua tiav? Tom qab ntawd cia peb pib daemon.
Kauj Ruam 4: Pib YalerTunnel Daemon
Pab kom SSH nkag tau ntawm Yaler
$ sudo apt-tau nruab runit
- Tsim cov npe yalertunnel-ssh cov kev pabcuam
$ sudo mkdir/etc/service/yalertunnel-ssh
$ cd/etc/service/yalertunnel-ssh
- Rub tawm yalertunnel khiav tsab ntawv thiab ua kom nws ua tiav
$ sudo wget https://s3.yaler.net/raspi/run-ssh -O khiav
$ sudo chmod a+x khiav
- Rub tawm yalertunnel tsab ntawv ua tiav thiab ua kom nws ua tiav
$ sudo wget
$ sudo chmod a+x ua tiav
- Qhib tsab ntawv khiav nrog
$ sudo nano/etc/service/yalertunnel-ssh/khiav
- Txheeb xyuas txoj hauv kev (lub neej ntawd:/tsev/pi/yalertunnel), teeb tsa qhov chaw nres nkoj ntawm SSH cov kev pabcuam hauv zos (lub hauv paus: 22), thiab teeb tsa koj qhov chaw xa khoom
1 #!/Bin/sh
⋮ 6 exec/home/pi/yalertunnel/yalertunnel proxy 127.0.0.1:22 try.yaler.io:80 RELAY_DOMAIN & 1 | logger -t yalertunnel -ssh
Txuag kev hloov pauv nrog CTRL-X, tom qab ntawd Y, tom qab ntawd rov qab. Tsis txhob hloov tus IP hauv zos (lub neej ntawd: 127.0.0.1), tshwj tsis yog SSH cov kev pabcuam khiav ntawm ib lub cuab yeej sib cais hauv tib lub network.
- Rov pib dua koj lub Raspberry Pi 2 kom khiav cov ntawv
$ sudo rov pib dua
Ua tiav Tam sim no cia saib yuav nkag mus rau Raspi li cas.
Kauj Ruam 5: Nkag mus rau Raspberry Pi 2 Nrog rau SSH Client
Siv Putty ntawm Windows
- Ua raws cov kauj ruam
Siv ssh ntawm Mac lossis Linux
Tsis zoo li Putty, ssh hais kom ua tsis txhawb "HTTP CONNECT", yog li peb xav tau YalerTunnel ntawm no ib sab ntawm kev xa tawm, ib yam nkaus. Nov yog qhov zoo li cas:
SSH Client -> YalerTunnel hauv Client Mode -> (Firewall) -> Relay Service
Nruab YalerTunnel ntawm Mac lossis Linux
- Nco ntsoov JDK6 (lossis tom qab) tau teeb tsa
- Nco ntsoov tias koj qhov PATH ib puag ncig sib txawv muaj JDK's bin directory
- Tau txais YalerTunnel Java qhov chaw los ntawm
- Unzip cov ntawv ZIP, qhib lub davhlau ya nyob twg, thiab tsim YalerTunnel nrog
$ javac YalerTunnel.java
Nkag mus rau Raspberry Pi 2 nyob deb nrog SSH
- Ntawm koj lub khoos phis tawj neeg siv khoom, kom pib YalerTunnel hauv cov neeg siv khoom hom, ntaus ntawv
$ java YalerTunnel tus thov kev pabcuam localhost: 10022 try.yaler.io:80 RELAY_DOMAIN
- Hauv lub davhlau ya nyob twg thib ob, ntawm lub khoos phis tawj neeg siv khoom, nkag mus rau koj lub cuab yeej ntawm YalerTunnel hauv zos nrog ssh
$ ssh pi@localhost -p 10022 -o ServerAliveInterval = 5
Ua tiav Tam sim no koj yuav tsum muaj SSH nkag mus rau koj li Raspberry Pi 2.
Teeb meem
Yog tias tsis muaj kev sib txuas
- Nco ntsoov tias koj siv qhov chaw xa khoom raug
- Kom pom tias YalerTunnel qhov kev pabcuam tau ua haujlwm ntawm koj lub cuab yeej, ntaus ntawv
$ ps aux | grep [y] ceeb toom
Qhov ntawd yog nws. Ua tsaug rau kev nyeem kom txog thaum kawg. Yog tias koj muaj lus nug, tiv tauj.
Pom zoo:
Tej thaj chaw deb Servo Dropper rau Drone Nuv Ntses Super Neat: 7 Kauj Ruam
Tej thaj chaw deb Servo Dropper rau Drone Nuv Ntses Super Neat: ntawm no yog li cas kuv tsim tau qhov ua tau zoo txaus me ntsis me me servo dropper los ntawm ntu kuv tau dag ib puag ncig qhov no yuav haum rau drone nuv ntses poob cov khoom random nrog koj lub drone rau kev lom zem xws li khoom noj txom ncauj ntawm cov phooj ywg thiab tso dej zais pa rau lawv
Tej thaj chaw deb tswj Buzzer rau Poob-thiab-Pom: 4 Cov Kauj Ruam
Tej thaj chaw deb tswj Buzzer rau Poob-thiab-Pom: Qhov ob ntu ntu no muaj lub suab nrov thiab tus tswj. Txuas lub buzzer rau ib yam khoom uas koj yuav nquag plam, thiab siv lub pob thiab lub pob qhov rooj ntawm tus tswj kom qhib lub buzzer thaum cov khoom poob. Lub suab nrov thiab tswj
Nkag Mus Nkag Rau Raspberry Pi nyob deb: SSH, Dekstop & FTP: 4 Kauj Ruam
Kev Nkag Mus Nkag Mus Rau Raspberry Pi nyob deb: SSH, Dekstop & FTP: Hauv kab ntawv no, peb tab tom saib 3 txoj hauv kev sib txawv uas koj tuaj yeem nkag mus rau Raspberry Pi nyob deb kom yooj yim ua haujlwm nrog nws. Thawj qhov yog SSH, uas yuav tso cai rau koj nkag mus rau lub davhlau ya nyob twg. Qhov thib ob yog remo
Tej thaj chaw deb rau PC Youtube thiab Netflix: 9 Kauj Ruam (nrog Duab)
Tej thaj chaw deb rau PC Youtube thiab Netflix: Kuv muaj kuv lub khoos phis tawj lub computer deb ntawm kuv lub txaj yog li kuv nyiam saib youtube thiab tsos los ntawm kev nplij siab ntawm kuv lub txaj. Txhua lub sijhawm kuv tso tseg txawm li cas los kuv pom kuv tus kheej xav tau kho lub ntim, ncua video rau qee qhov laj thawj lossis tsuas yog hla cov vis dis aus nkaus xwb
Tej thaj chaw deb Shutter Trigger rau Cov Koob Yees Duab: 4 Kauj Ruam
Kev Siv Hluav Taws Xob Hluav Taws Xob Ua Rau Lub Koob Yees Duab: Ua lub kaw suab kaw rau koj lub koob yees duab digital (thiab qee lub npe xws li Pentax, sony, thiab qee lub nikons) txog li 3 daus las hauv 5 feeb, txawm tias qib 1 tuaj yeem ua qhov no. Qhov no yog qhov zoo rau qhov tau txais qhov ua kom zoo tshaj plaws, thiab ua kom zoo