【发布时间】: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