Siber Güvenlik
1 dakika okuma
SSH Tunku ile Güvenli Uzak Erisim
SSH tununell kurulumu, port yonlendirme, SOCKS proxy ve VPN alternatifi olarak SSH.
E
Emre Cihan SSH Tuneli Turleri
Local Port Forwarding: Uzak servise yerel porttan erisim Remote Port Forwarding: Yerel servisi uzaktan erisilebilir yap Dynamic Port Forwarding: SOCKS proxy
Local Port Forwarding
# Uzaktaki MySQL'e yerel porttan erisim
ssh -L 3307:localhost:3306 kullanici@uzak-sunucu -N
# Artik localhost:3307 -> uzak-sunucu:3306
# Uzaktaki web arayuzune erisim
ssh -L 8080:192.168.1.100:80 kullanici@sunucu -N
# Artik localhost:8080 -> iç ag 192.168.1.100:80
# Arkaplanda calistır
ssh -L 3307:localhost:3306 kullanici@sunucu -fN
Remote Port Forwarding
# Yerel servisi internete ac (geçici ngrok alternatifi)
ssh -R 8080:localhost:3000 kullanici@sunucu -N
# Sunucuda 8080 -> yerel 3000
# GatewayPorts aktif etmek gerekebilir
# /etc/ssh/sshd_config'e ekle:
# GatewayPorts yes
Dynamic Forwarding (SOCKS Proxy)
# SOCKS5 proxy olustur
ssh -D 1080 kullanici@sunucu -N
# Tarayicida SOCKS5 proxy ayarla: localhost:1080
# veya curl ile:
curl --socks5 localhost:1080 https://api.hedef.com
# Tum trafigi yonlendir
export ALL_PROXY=socks5://localhost:1080
~/.ssh/config ile Kolay Yonetim
Host sunucu-1
HostName 1.2.3.4
User ubuntu
Port 2222
IdentityFile ~/.ssh/id_ed25519
ServerAliveInterval 60
LocalForward 3307 localhost:3306
Host jump-host
HostName jump.emrecihan.com.tr
User emre
Host ic-ag
HostName 192.168.1.50
User emre
ProxyJump jump-host # Jump host uzerinden
SSH tuneli, kurumsal guvenlik duvarlarini asarak guvenli erisim saglamanin en kolay yoludur.
Paylaş:
Twitter / X
E
Emre Cihan
Sistem Yöneticisi · Maker · Elektronik Meraklısı
İlgili yazılar