鉴于以下限制,我如何使用Windows和Unix中的GitHub?
Gre*_*con 22
请参阅Jeff Tchang 的"使用Github通过Draconian Proxies(Windows和Unix)"(以前可从其他位置获得),其中包括Windows和Unix平台的说明,总结如下.
编辑或创建文件~/.ssh/config并输入以下内容:
Run Code Online (Sandbox Code Playgroud)ProxyCommand /usr/bin/corkscrew proxy.example.com 443 %h %p ~/.ssh/myauth Host github.com User git Port 22 Hostname github.com IdentityFile "/media/truecrypt1/Keys/GitHubKey.private" TCPKeepAlive yes IdentitiesOnly yes Host ssh.github.com User git Port 443 Hostname ssh.github.com IdentityFile "/media/truecrypt1/Keys/GitHubKey.private" TCPKeepAlive yes IdentitiesOnly yes
如果一切设置正确,您应该能够运行ssh github.com并查看
嗨用户!您已成功通过身份验证,但GitHub不提供shell访问权限.
与github.com的连接已关闭.
如果这不起作用,你可以运行ssh ssh.github.com并得到完全相同的东西.如果第一个命令不起作用,则意味着您正在使用阻止端口22上的CONNECT的代理.几乎没有代理阻止端口443上的CONNECT,因为您需要SSL.
connect.exe在C:\Windows\connect.exe.cmd.exe来做东西或者使用Cygwin风格的shell.或两者.设置Cygwin Git bash shell.
对于Cygwin样式shell,启动Git图标并编辑文件~/.ssh/config,并确保文件没有扩展名.将以下内容放在该文件中,并注意如何指定路径.
Run Code Online (Sandbox Code Playgroud)ProxyCommand /c/windows/connect.exe -H username@proxy.example.com:443 %h %p Host github.com User git Port 22 Hostname github.com IdentityFile "/c/Keys/GitHubKey.private" TCPKeepAlive yes IdentitiesOnly yes Host ssh.github.com User git Port 443 Hostname ssh.github.com IdentityFile "/c/Keys/GitHubKey.private" TCPKeepAlive yes IdentitiesOnly yes
设置Windows cmd.exeshell.
假设您不喜欢Git Bash shell.您更喜欢cmd.exe解释器.
C:\Documents and Settings\.ssh\configconfig-windows将以下内容放在文件中,再次注意路径分隔符和样式.
Run Code Online (Sandbox Code Playgroud)ProxyCommand C:/Windows/connect.exe -H username@proxy.example.com:443 %h %p Host github.com User git Port 22 Hostname github.com IdentityFile "C:\Keys\GitHubKey.private" TCPKeepAlive yes IdentitiesOnly yes Host ssh.github.com User git Port 443 Hostname ssh.github.com IdentityFile "C:\Keys\GitHubKey.private" TCPKeepAlive yes IdentitiesOnly yes
有关完整详细信息,请参阅完整的博客文章.