SSHã®Dynamic Forwardã§SOCKS Proxyãã¦ã¿ã
ã客ããã®ãµã¼ãã«ã¢ã¯ã»ã¹ããã®ã«è¸ã¿å°ãµã¼ããçµç±ããªãããããªããã ãã©ããã¡ãã¡2åãã°ã¤ã³ããã®ãé¢åãããã£ãã®ã§ãPuTTYä»å±ã®pfwdã§Dynamic Forwardãã¦ã¿ãã便å©ã«ãªã£ãã
ãã¹ã¼ããã¯ä¾¿å©ã ã¨ä¸äººã§çãä¸ãã£ã¦ããã社å
Wikiã«ããæ¹æ¸ãã¦ããã£ã¦è¨ãããã®ã§ã¤ãã§ã«ãã£ã¡ã«ãæ¸ãã¦ããã
ãã®Dynamic Forwardãå©ç¨ããã¨ãSSHã§ãã°ã¤ã³ããå
ãSOCKS Proxyã¨ãã¦å©ç¨ã§ããã®ã§ããã¨ã¯SOCKS対å¿ã¢ããªã®è¨å®ãå¤æ´ãã¦ã¢ã¯ã»ã¹ããã°å
¨é¨ãã°ã¤ã³å
ããã®ã¢ã¯ã»ã¹ã£ã¦ãã¨ã«ãªãã
Port Forwardã¨éã£ã¦ä½çªãä½çªã£ã¦ã®ããªãã®ã§ä¾¿å©ã
SOCKS対å¿ã®ã¢ããªã£ã¦ä½ããããã ããã£ã¦æããããããªããã©ããã¨å¯¾å¿ãã¦ãããã®ã¯å¤ãã
主è¦ãã©ã¦ã¶ã¯Opera以å¤ã ããã対å¿ãã¦ãããä¼ç¤¾ã®PCã§ç¢ºèªã§ããã ãã§ãThunderbirdãWinSCPãFFFTPãTeraTermãWindows Live Messengerãããã対å¿ãã¦ããã
Windowsã ã¨PortForwarderã¨ãè²ã
ãããã©ãã¨ãããã身è¿ãªPuTTYã§ã
ãªãªã¸ãã«ã®PuTTYã«ã¯å®ã¯ãªãã¦ãPuTTYごった煮版ã«å梱ããã¦ããpfwd.exeã使ãã
PuTTYæ¬ä½ã§ããã³ãã«ã®è¨å®ã§ããã¤ãããã¯ããé¸æããã°åºæ¥ããã©ãpfwdãªãã¿ã¹ã¯ãã¬ã¤ã«å¸¸é§ãã¦ããã¦ã¦ã£ã³ãã¦ãéªéã«ãªããªãã®ã§ããããã
pfwdã®è¨å®
ãã£ãç
®çã«å梱ã®pfwd_sample.iniãpfwd.iniã¨ããååã§ã³ãã¼ããããªãã¼ã ã§ããããã©ã
ãã§ã次ã®ãããªæãã§ç·¨éããï¼é·ãã®ã§ã³ã¡ã³ãã¯çç¥ããï¼ã
[SSH] Host=è¸ã¿å°ãµã¼ãã®ã¢ãã¬ã¹ Port=22 Compression=1 ProtocolVersion=2 PrivateKey=è¸ã¿å°ãµã¼ãã§éµèªè¨¼ã«ä½¿ãèªåã®ç§å¯éµ User=è¸ã¿å°ãµã¼ãã®ãã°ã¤ã³ã¦ã¼ã¶ ;Password= [FORWARD] 01=D1080
[SSH]ã®é¨åã§è¸ã¿å°ãµã¼ãã®è¨å®ãããã
- Host
- è¸ã¿å°ãµã¼ãã®ã¢ãã¬ã¹
- Port
- è¸ã¿å°ãµã¼ãã®sshãã¼ã
- User
- è¸ã¿å°ãµã¼ãã«ãã°ã¤ã³ããã¦ã¼ã¶
- PrivateKey
- éµèªè¨¼ã®å ´åã¯èªåã®ç§å¯éµ
- Password
- ãã¹ã¯ã¼ããéµèªè¨¼ã®å ´åã¯ã³ã¡ã³ãã¢ã¦ãã§ãï½
ç¶ãã¦[FORWARD]ã®é¨åã§Port Forwardã¨ãDynamic Forwardã®è¨å®ãããã
ãã¶ããµã³ãã«ã«ã¯ããã©ã«ãã§ããã¤ãè¨è¿°ããã¦ããã¨æãã®ã§ãä¸è¦ãªãåé¤ãããªãã³ã¡ã³ãã¢ã¦ããããªãã
ãã¼åã¯01ããé£çªã§ä½¿ãããããã ãã©ãæ¬ çªãããã¨ãã¾ãåããªãã£ãã®ã§ããã©ã«ããæ¶ãã¨ãã¯æ³¨æã
ã§ãDynamic Forwardã®å ´åã¯D<ãã¼ãçªå·>ã¨ããè¨å®ãããããã®ãã¼ãçªå·ããã¼ã«ã«ã§ã®å¾
ã¡åããã¼ãã«ãªãã®ã§ãã¢ããªã®ãããã·è¨å®ã§ã¯ãã®ãã¼ããæå®ãããä¸è¬çã«ã¯1080ãããã
pfwd.exeãèµ·å
èµ·åããã
éµã«ãã¹ãã¬ã¼ãºãããã£ã¦ãå ´åã¯ãã¤ã¢ãã°ãåºã¦ããã®ã§å
¥åãããpageant.exeãæã£ã¦ãã°èãã¦ããªãã
ããã§è¸ã¿å°ãµã¼ãã«è£ã§ãã°ã¤ã³ãã¤ã¤SOCKS Proxyã¨ãã¦ãã¼ãã®å¾
ã¡åããå§ããã
å種ã¢ããªããæ¥ç¶
ã¢ããªã«ãã£ã¦ã¾ã¡ã¾ã¡ã ãããã©ãããã¯ã¼ã¯ã®è¨å®ã¨ããããã·ã®è¨å®ã¨ããããããã¨ãããè¦ã¤ãã¦ããã¹ãå=localhostããã¼ã=pfwd.iniã§è¨å®ããçªå·ã§è¨å®ããã°ããã
ãããã·ã®ç¨®é¡ãé¸æã§ããå ´åã¯ã¨ããããSOCKS 5ãé¸ã¹ã°ããã¨æããï¼ããã¾ããããªãå ´åã¯SOCKS 4ãããã§ãã ããªå ´åã¯ä½ããééã£ã¦ãããããã使ããªããã ã¨æãã
Firefoxã®å ´åãnetwork.proxy.socks_remote_dnsãtrueã«ããã¨SOCKSãµã¼ãå´ã§åå解決ããã¦ãããããã«ãªãã
Linuxã®å ´å
Linuxã£ã¤ã¼ãOpenSSHã¯ã©ã¤ã¢ã³ãã®å ´åã¯-Dãªãã·ã§ã³ã§åããã¨ãåºæ¥ãã
æ常çã«å©ç¨ãããªã~/.ssh/configã®DynamicForwardã§è¨å®ãã¦ãããã
ssh -D localhost:1080 -l è¸ã¿å°ãµã¼ãã®ã¦ã¼ã¶ è¸ã¿å°ãµã¼ãã®ã¢ãã¬ã¹
ããã ã¨æ®éã«ãã°ã¤ã³ãã¡ããã®ã§è£ã§åãã¦æ¬²ããã¨ãã¯Port Forwardã§ããããã¿ããã«-Nã¨-fãä»ããã°ããã®ããªï¼
ssh -N -f -D localhost:1080 -l è¸ã¿å°ãµã¼ãã®ã¦ã¼ã¶ è¸ã¿å°ãµã¼ãã®ã¢ãã¬ã¹