代码之家  ›  专栏  ›  技术社区  ›  slayerIQ

Git通过端口443

  •  2
  • slayerIQ  · 技术社区  · 16 年前

    我的服务器上有一个git存储库,我可以通过端口443进行ssh连接,但是现在我想从服务器上拉并推送到它,但是git给我的连接被拒绝了。我想它是通过端口22连接的,但我想它是通过443连接的。我用tortoiseplink来连接,当我推或拉的时候,怎样才能使它通过端口443连接?

    2 回复  |  直到 16 年前
        1
  •  7
  •   VonC    16 年前

    首先,git将在shell中执行命令,在shell中查找环境变量 HOME (不是Windows标准环境变量)。

    ~/.ssh/id_rsa(.pub) .
    ssh-keygen -t rsa .
    authorized_keys

    最后,在你的 HOME/.ssh 目录,创建一个名为' config

    host remoteServer
    user yourLogin
    hostname remoteServerName
    port 443
    identityfile ~/.ssh/id_rsa
    

    然后您应该能够使用git pull或git push

    git pull remoteServer:/path/to/repo.git
    
        2
  •  4
  •   jamessan    16 年前

    定义远程端口,使其使用端口443,或者设置ssh配置,使其知道该主机使用端口443。

    git remote add origin ssh://some.host:443/path/to/repo.git
    
    推荐文章