Thuta Learning
ရှာဖွေရန်
IntermediateHardwarebeginner

Connecting via SSH

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

ဒီခန်းပြီးရင် ဘာတတ်သွားမလဲ

  • Connecting via SSH ကို ကြောက်စရာမလိုအောင် နားလည်မယ်
  • ကိုယ်တိုင် hardware wiring/code ကို run ကြည့်တတ်မယ်
  • Real project ထဲမှာ ဒီ concept ကို ချက်ချင်း အသုံးချတတ်မယ်

ခဏလေး ဒီလိုပဲ စဉ်းစားကြည့်

SSH ဆိုတာ Linux tutorial က အသေးစိတ် လေ့လာခဲ့ပြီးသား protocol ပါ — Raspberry Pi ကို SSH ဖြင့် ချိတ်ဆက်ဖို့ ပထမဆုံး Pi ရဲ့ IP address ကို သိထားရပါမယ် (router admin panel ကနေ ကြည့်နိုင်, ဒါမှမဟုတ် hostname.local ဖြင့် mDNS resolution ကို သုံးနိုင်)။ ssh username@raspberrypi.local (ဒါမှမဟုတ် ssh username@ip-address) ကို run ပြီး password ရိုက်ရင် Pi ရဲ့ terminal ကို ချက်ချင်း access ရပါတယ်။

လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်

SSH key authentication (password အစား) ကို setup လုပ်ထားရင် Cybersecurity tutorial ရဲ့ password/2FA concept အတိုင်း ပိုလုံခြုံပါတယ် — ssh-keygen ကနေ key pair ဖန်တီးပြီး, ssh-copy-id ကနေ public key ကို Pi ဆီ ကူးထားရင် password မလိုဘဲ login ဝင်နိုင်ပါတယ် (Linux tutorial ရဲ့ SSH lesson အတိုင်း အတိအကျ)။

အတူတူ ကြည့်မယ်

bash
# Find your Pi's IP (from router admin panel), then:
ssh pi@raspberrypi.local
# or
ssh pi@192.168.1.42

# Set up key-based auth (from your computer)
ssh-keygen -t ed25519
ssh-copy-id pi@raspberrypi.local
ssh pi@raspberrypi.local   # password မလို, key နဲ့ တန်းဝင်
You should see
SSH connection အောင်မြင်ရင် terminal prompt က pi@raspberrypi:~$ ပုံစံ ပြောင်းသွားမည်။

၅ မိနစ် စမ်းကြည့်

Linux tutorial ကနေ SSH key pair ရှိပြီးသားဆိုရင် (ssh-keygen), Raspberry Pi ဆီ ssh-copy-id ဖြင့် public key ကို ကူးပို့ကြည့်ပါ။

သတိလေးတစ်ချက်

Pi ကို internet ပေါ် port forward လုပ်ပြီး SSH ဖွင့်ချင်ရင် Cybersecurity tutorial ရဲ့ 'Linux Server Hardening' lesson (key-only auth, fail2ban) ကို အမြဲလိုက်နာပါ — default password + open SSH port က scan bot တွေရဲ့ ပစ်မှတ်ဖြစ်နိုင်ပါတယ်။

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • Pi ရဲ့ raspi-config ထဲမှာ SSH ကို enable မလုပ်ထားလို့ 'connection refused' error ရခြင်း
  • Wi-Fi network တူတူ ချိတ်ထားခြင်း မရှိဘဲ hostname.local ဖြင့် connect ကြိုးစားခြင်း (mDNS ကို same-network requirement)

အခု ကိုယ်တိုင် စမ်းကြည့်

Linux tutorial ကနေ SSH key pair ရှိပြီးသားဆိုရင် (ssh-keygen), Raspberry Pi ဆီ ssh-copy-id ဖြင့် public key ကို ကူးပို့ကြည့်ပါ။

You'll know it worked when: SSH connection အောင်မြင်ရင် terminal prompt က pi@raspberrypi:~$ ပုံစံ ပြောင်းသွားမည်။

Connecting via SSH | Thuta Learning