【问题标题】:How to connect to git remote via ssh on Media Temple Centos?如何在 Media Temple Centos 上通过 ssh 连接到 git 远程?
【发布时间】:2021-05-02 15:46:58
【问题描述】:

我在我的 Centos 7 上创建了一个新用户,添加了一个 .ssh 文件夹,其中包含我在 authorized_keys 中的公钥。我能够通过 ssh 成功连接到该用户的服务器

ssh <username>@<ipaddress>

我还在服务器上创建了一个裸 git repo:

/var/repo/<reponame>.git

并使用以下方法在我的本地计算机上添加了一个遥控器:

git remote add origin <username>@<ipaddress>:/var/repo/<reponame>.git

当我跑步时:

git remote show origin

git push origin master

挂起,然后给出响应:

ssh: connect to host <ipaddress> port 22: Operation timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我不知道为什么我可以通过 SSH 成功连接,但是这个命令失败了。您能提供的任何帮助都绝对令人惊叹。

【问题讨论】:

    标签: git ssh centos7 mediatemple


    【解决方案1】:

    首先检查您成功的 ssh 连接是否带有来自远程用户 ~/.profile~/.bashrc 的输出。

    理想情况下,它应该是静音的。

    当您打开交互式 SSH 会话时,还要检查 git 是否可用(在默认系统 PATH 中)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-10-30
      • 2011-12-12
      • 1970-01-01
      • 2012-09-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多