
原文指路:https://mp.weixin.qq.com/s/0gTeUoS1tYWjUyDvRtsOuw
腾讯云CloudStudio开始支持通过SSH方式Clone Github仓库。本教程将指导你如何通过 SSH 方式克隆 GitHub 仓库,特别是在需要使用代理的情况下。我们将使用 socat 工具来配置 SSH 代理。
下面是执行代码:
在你的ubuntu系统终端中:
1.更新系统并安装 socat
apt update -y && apt install -y socat2. 配置ssh(直接复制,回车)
接下来,我们需要配置 SSH 以通过代理连接到 GitHub。编辑 ~/.ssh/config 文件,添加以下内容
cat << EOF >> ~/.ssh/configHost github.com Hostname ssh.github.com Port 443 User git ProxyCommand socat - PROXY:proxy.cloudstudio.work:%h:%p,proxyport=8081EOFHost github.com:指定 GitHub 的主机名。Hostname ssh.github.com:指定 GitHub 的 SSH 主机名。Port 443:指定 SSH 连接的端口号。User git:指定 SSH 连接的用户名。ProxyCommand socat - PROXY:proxy.cloudstudio.work:%h:%p,proxyport=8081:指定通过 socat 工具使用代理连接。3. 最后修改权限
为了确保 SSH 配置文件的安全性,我们需要设置正确的文件权限。
chmod 600 ~/.ssh/config 三步走,即可解决CloudStudio只能使用https方式clone Github Repo的问题。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。