Tema
Setup Akses SSH & MySQL
Catatan Penting
WARNING
Jangan pernah menyebarkan file SSH private key maupun public key kepada pihak lain. File berikut adalah kredensial akses server:
- `id_ed25519`
- `id_ed25519.pub`1. Setting Akses SSH
Buka folder .ssh
Lokasi default:
txt
C:\Users\USERNAME\.sshGanti USERNAME dengan username Windows masing-masing.
Contoh:
txt
C:\Users\alam\.sshMasukkan file SSH key
Copy file berikut ke folder .ssh:
txt
id_ed25519
id_ed25519.pubInfo
Silahkan minta file terkait ke pihak berkaitan
Buat file config
Buka CMD di direktori:
txt
C:\Users\USERNAME\.sshLalu jalankan command berikut:
powershell
New-Item config -ItemType File2. Forward Port MySQL
Edit file config
Isi file config dengan konfigurasi berikut:
ssh-config
Host tba-remote
Hostname tridenteberkahabadi.com
port 2223
User trih8462
ServerAliveInterval 60
ServerAliveCountMax 3
LocalForward 3307 127.0.0.1:3306
ExitOnForwardFailure yes3. Cara Akses SSH
Buka CMD lalu jalankan command berikut:
bash
ssh tba-remote4. Akses Pertama Kali
Saat pertama kali connect akan muncul pertanyaan:
txt
Are you sure you want to continue connecting (yes/no/[fingerprint])?Ketik:
txt
yesLalu tekan Enter.
5. Informasi Forward Port MySQL
Setelah SSH berhasil terkoneksi:
txt
localhost:3307akan otomatis diteruskan ke:
txt
127.0.0.1:3306di server remote.
Aplikasi lokal seperti:
- DBeaver
- HeidiSQL
- TablePlus
- Laravel
- dan seluruh umat debugging database
bisa mengakses MySQL server melalui:
txt
Host : 127.0.0.1
Port : 3307Tanpa harus membuka port database langsung ke internet.
Untuk sekali ini, umat manusia mengambil keputusan yang tidak sepenuhnya berbahaya.