ãµã«ã§ãåããå¤æ®µssh
ãä»äºããã¦ããã¨ãã客ããã®ç°å¢ã«ãã°ã¤ã³ããããã
- è¸ã¿å°ãã·ã³ãçµç±ããå¿ è¦ããã
- è¸ã¿å°ãã·ã³ã¸ã®ãã°ã¤ã³ãããç¹å®ç¯å²ã®IPã¢ãã¬ã¹ããããåãä»ãã¦ãããªã
ãã¨ãã£ãå³ããæ¡ä»¶ãæºãããªããã°ãªããªãå ´åããããå¤æ®µã«sshãããªããã°ãããªããã¨ããããããããåç´ãªå¤æ®µsshã«ã¯ã
- æ¯åé ç¹°ãã«å¤æ®µãã°ã¤ã³ããã®ã¯çµæ§ããã©ããã
- scpã§ãã¡ãã¡ä¸ç¶ãµã¼ãã¼ã«ã³ãã¼ãã¦ããå¿ è¦ããããä¸éãµã¼ãã¼ã®ãã£ã¹ã¯å®¹éã足ããªãå ´åã«å¤§ããªãã¡ã¤ã«ãã³ãã¼ã§ããªã
ãã¨ãã£ãåé¡ãããã
ãå®ã¯ãsshã«ã¯è¨å®ãã¡ã¤ã«ããããè¨å®ãè¡ããã¨ã§ãéã«ä½å°ã®ãµã¼ãã¼ãæãã§ãããã¨ããããããç´æ¥ã¢ã¯ã»ã¹ãã¦ãããã®ããã«æ¥ç¶ãããã¨ãã§ããã®ã§ããããä¸éçã«ã¯ãã¾ãç¥ããã¦ããªãããã ãç¥ããªãã®ã¯é常ã«ãã£ãããªãã®ã§ãç°¡åã«èª¬æãã¦ããã
ãè¨å®ãã¡ã¤ã«ã¯~/.ssh/configã«ããããªããã°èªåã§ä½ãã
ãã¾ããè¨å®ãã¡ã¤ã«ã®æ¸ãæ¹ãªã®ã ããåºæ¬çã«ã¯ãã¹ãåä½ã§ããããã¨è¨å®é
ç®ãæ¸ãã¦ããã
Host host2 ProxyCommand ssh host1 nc %h %p
ãhost1, host2ã®é¨åã§ãhost1ã«è¸ã¿å°ã®ååããhost2ã«ã¢ã¯ã»ã¹ããããµã¼ãã¼ã®ååãæ¸ããProxyCommandã¨ããã®ã¯ãã®åã®éãããã®ãã¹ãã«æ¥ç¶ãã«è¡ãåã«ãããããããã®ã³ãã³ããå®è¡ãã¦ããããã¨ãããã®ã§ãããncã¨ããã®ã¯ã³ãã³ãã§ãmanã«ããã¨ãnc â arbitrary TCP and UDP connections and listensãã¨ããããã©ãããããã°ã©ã ãªã®ãã¯æ£ç´è¯ãããã£ã¦ãªããconnect.cã¨ããä»ã«ãåæ§ã®äºããã¦ãããããã°ã©ã ã¯ããã¤ãããã¿ãããªã®ã ããncã¯æè¿ã®Linux Distributionã ã¨ããã©ã«ãã§å
¥ã£ã¦ãããã¨ãå¤ãã¿ããã§ãncã¨æ¸ãã¦ããã¦å°ããã¨ã¯ã»ã¼ãªãã
ãããã ãã§host1ã®äºã¯ç¡è¦ãã¦ç´æ¥host2ã«æ¥ç¶ãã¦ããã¿ããã«sshãããscpããããããã¨ãã§ãããããã«ãhost2ãè¸ã¿å°ã¨ãã¦host3ã«è¡ãããå ´åã¯
Host host3 ProxyCommand ssh host2 nc %h %p Host host2 ProxyCommand ssh host1 nc %h %p
ãã¨æ¸ãã¦ããã°ãssh host3ã¨ããã¨ãèªåããhost1, host2ã®2å°ã®è¸ã¿å°ãçµç±ãã¦host3ã«æ¥ç¶ãããã¨ãã§ãããå½ç¶ããã£ã¨è¸ã¿å°ãå¢ãããã¨ãã§ãããä½æ®µã¾ã§å¯è½ãªã®ãã¯è©¦ãããã¨ããªãã®ã§ããããªãããåççã«ã¯ãããã§ãããããã ã
ãå®ã¯ããã®è¨å®ã¯sshãããã¨ãã«ä¾¿å©ã ã¨ããã ãã§ã¯ãªããemacsã§tramp modeã使ãã¨ããªã©ã«ãé常ã«æå¹ã§ãããtramp modeã®multi hopã®è¨å®ã¯ãµã³ãã«ãå°ãªãããæ£ç´è¯ãããããªãã®ã ããsshå´ã§è¨å®ãã¦ãã¾ãã°åé¡ãªããè¸ã¿å°ã®åããå´ã«ãããã¡ã¤ã«ãæå
ã®emacsã§ç·¨éãããã¨ãåºæ¥ãã
ããã®ä»ã«ããsshã®è¨å®ãã¡ã¤ã«ã«ã¯ã
- ãã¹ãæ¯ã«ãã°ã¤ã³ããã¦ã¼ã¶ã¼åãå¤ããæ©è½
- ãã¹ãæ¯ã«ä½¿ãsshã®éµãå¤ããæ©è½
ããªã©ã使ãããªãã¨ä¾¿å©ãªæ©è½ã沢山ããã®ã§ããã²ä½¿ãããªãã¦ä¾¿å©ãªsshã©ã¤ããéã£ã¦ããã ãããã
ããã¨ãæ¸ãã¦ãéä¸ã«è¦ã¤ãããã ãã©ããã§ã«ã¨ã¦ãè¯ãè¨äºãããã¾ãããâãncある限りぼくはどこまででもいけるッ!