0.5から始める機械学習

Machine Learning, Deep Learning, Computer Vision に関する備忘録

【GitLab】 Proxy環境下でGitLabにssh接続する

Proxy環境下でのGitLab接続方法について

Proxyのせいでイライラさせられた人向けのTipsです。

設定方法

  • sshキーをGitLabに登録済みという前提です。

~/.ssh/config に以下の記述をします(configがない場合は作成しましょう)。

Host gitlab.com
    HostName altssh.gitlab.com  
    IdentityFile ~/.ssh/id_rsa  
    Port 443  
    ProxyCommand nc -X connect -x proxy.example.co.jp:8080 %h %p

Portは状況に合わせて変更ください。

sshが通るかの確認は、

ssh -T git@gitlab.com

# Welcom to GitLab, @user! ← これが表示されればOK!

まとめ

Proxy難民が一人でも救われますように...