notes icon indicating copy to clipboard operation
notes copied to clipboard

如何科学访问github or github ssh proxy

Open lanlin opened this issue 7 years ago • 1 comments

场景

为了科学的通过 ssh 访问 github,从而快速管理代码。

方法

Host github.com
     hostname github.com
     AddKeysToAgent yes
     IdentityFile ~/.ssh/github_rsa               # 你的 github 的 ssh key
     ProxyCommand nc -x 127.0.0.1:1080 %h %p      # 你的科学代理地址端口

在你的 ~/.ssh/config 中添加上述配置并保存,搞定。

补充

  1. 关于为什么要用 ssh 而不用 http 或者 https 来访问托管的项目。 请参见 #41 中的说明。

  2. 关于如何生成 ssh key 请参见 Generating a new SSH key and adding it to the ssh-agent

  3. 科学请自备。 PS: 如果你有安全、免费、稳定、不限速的科学工具,请务必留言分享!

lanlin avatar Nov 12 '18 09:11 lanlin

git配置参考

#40 git配置备忘 or git config

lanlin avatar Nov 03 '21 08:11 lanlin