From 0e57986e3465220603edb64a49c7d9146abf23ff Mon Sep 17 00:00:00 2001 From: Chen Junda Date: Thu, 5 Jan 2023 15:09:34 +0800 Subject: [PATCH] docs: update Windows setup --- README.cn.md | 15 ++++++++------- README.md | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/README.cn.md b/README.cn.md index 5bb5f40..157d7c1 100644 --- a/README.cn.md +++ b/README.cn.md @@ -119,23 +119,24 @@ export HTTPS_PROXY=$HTTP_PROXY ## 1. 配置SSH客户端使其使用本代理 -我们可以使用SSH客户端的`ProxyCommand`配置。 - -请参考这个StackOverflow的问题(https://stackoverflow.com/questions/19161960/connect-with-ssh-through-a-proxy)配置SSH客户端。将其中的`PROXYHOST:PROXYPORT`替换为这个代理服务器的地址和端口。具体来说,有如下几步: +这是推荐的方法。 +我们可以使用SSH客户端的`ProxyCommand`配置。这个配置好了之后,所有使用本地OpenSSH客户端的应用都可以使用代理访问服务器,其中还包括VSCode的Remote SSH功能! 1. 在机器上安装需要的程序 - - 在ArchLinux上为`openbsd-netcat`和`connect`。在不同的发行版上程序包名可能不同,这是Arch Linux下的包名。如果是其他操作系统,请参考上述提到的StackOverflow的问题 + - 在Arch Linux上为`openbsd-netcat`和`connect`。在不同的发行版上程序包名可能不同,这是Arch Linux下的包名。如果是其他操作系统,请参考下面的StackOverflow的问题 + - 在Windows上我们需要`connect.exe`。这个应用程序包含在`MinGW64`上,`Git for Windows`将会自动安装`MinGW`。所以你应该可以在Git安装目录的`mingw64/bin`目录下找到这个应用程序 2. 在`~/.ssh/config`中填写如下内容,并按您的需要和真实配置替换<>中的内容 ``` Host <需要使用代理进行连接的地址> - ProxyCommand nc -X connect -x localhost:<.env中配置的代理服务器端口> %h %p + ProxyCommand nc -X connect -x localhost:{.env中配置的代理服务器端口} %h %p + # Windows用户请参考下列地址 + # ProxyCommand {connect.exe的路径,如果需要的话加上引号} -H localhost:{.env中配置的代理服务器端口} %h %p ``` -如果SSH连接时遇到了问题,请看这个回答的评论部分。 +如果SSH连接时遇到了问题,请参考这个StackOverflow的问题(https://stackoverflow.com/questions/19161960/connect-with-ssh-through-a-proxy)。 -这是推荐的方法。 ## 2. 使用镜像中的SSH客户端 diff --git a/README.md b/README.md index c45ce40..f0a3d71 100644 --- a/README.md +++ b/README.md @@ -122,22 +122,23 @@ There are mainly 2 ways to use SSH with proxy. ## 1. Make SSH client use this proxy -We can utilize SSH client's `ProxyCommand` config to use HTTP proxy. +This is the recommended approach. -Please checkout this stackoverflow question (https://stackoverflow.com/questions/19161960/connect-with-ssh-through-a-proxy). Replace `PROXYHOST:PROXYPORT` with the address and port of this proxy server. The configurations mainly include the following steps: +We can utilize SSH client's `ProxyCommand` config to use HTTP proxy. With this setup, any client that uses local openssh client will be able to connect to the server through proxy, which also includes VSCode Remote SSH. 1. Install needed programs - In Arch Linux the programs are `openbsd-netcat` and `connect`. It differs in different distributions and OSs, so please check out the stackoverflow question above. -2. Add the following content into `~/.ssh/config`, replacing the content in <> accordingly + - In Windows, we need `connect.exe` which is installed alongside `MinGW64`, which is installed with `Git for Windows`. Therefore, you may find the `connect.exe` under the `mingw64/bin` folder under git's installation path +2. Add the following content into `~/.ssh/config`, replacing the content in {} accordingly ``` Host - ProxyCommand nc -X connect -x localhost: %h %p + ProxyCommand nc -X connect -x localhost:{proxy server port in .env} %h %p + # Windows user use the following path + # ProxyCommand {connect.exe path, quoted if necessary} -H localhost:{proxy server port in .env} %h %p ``` -If you encounter any error, check out other answers and comments in that stackoverflow question. - -This is the recommended approach. +If you encounter any error, check out other answers and comments in this stackoverflow question (https://stackoverflow.com/questions/19161960/connect-with-ssh-through-a-proxy). ## 2. Using SSH client in this image