태그 보관물: socks

Firewall 바깥의 git을 clone하기

Firewall등이 막고 있어서 외부의 git repository를 HTTPS로는 clone할 수 있지만 SSH로는 막히는 경우가 있다. 특히나 GitHub의 two-factor authentication을 설정한 경우라면 매번 token값을 입력하는 것 때문에 commit을 push하는게 매우 귀찮아진다.

이 문제는 ssh config file에 Proxy command를 설정해서 해결할 수 있는데
${HOME}/.ssh/config에 다음과 같이 추가해 주고, credential caching을 설정해 준다. (-S option에는 SOCKS port를 설정해야 함)

Host GitHub.com
  HostName github.com
  User git
  Port 22
  PorxyCommand connect-proxy -S {proxy-server}:{socks-port} %h %p