【问题标题】:Issues while trying to clone repository from local server to git user machine尝试将存储库从本地服务器克隆到 git 用户计算机时出现问题
【发布时间】:2013-11-04 08:46:30
【问题描述】:

我在尝试将 repository.git 文件夹从一台机器(表现为server)克隆到另一台机器(表现为client)时收到错误。我尝试过的Terminal commands 并收到了响应如下所示。

sonya@sonya-desktop:~/workspace$ git clone sonya@192.168.1.153:/home/user153/remote_repository.git
Cloning into 'remote_repository'...
ssh: connect to host 192.168.1.153 port 22: Connection refused
fatal: The remote end hung up unexpectedly

我也尝试过SSHTerminal commands 和收到的响应如下所示。在这两种情况下,我都面临同样的问题。

sonya@sonya-desktop:~/workspace$ git clone ssh://sonya@192.168.1.153/home/user153/remote_repository.git
Cloning into 'remote_repository'...
ssh: connect to host 192.168.1.153 port 22: Connection refused
fatal: The remote end hung up unexpectedly

Terminal commands的解释。

sonya:Git username我已经在我的服务器机器上创建了。

服务器机器的192.168.1.153:IP

服务器机器中remote_repository.git(git文件夹)的/home/user153/remote_repository.git:Path

任何人请帮忙。在此先感谢。

【问题讨论】:

  • 用户sonya可以使用ssh命令连接到服务器192.168.1.153吗?
  • 是的。我试过这样。响应是一样的。 sonya@sonya-desktop:~/workspace$ git clone ssh://sonya@192.168.1.153/home/user153/remote_repository.git 克隆到“remote_repository”... ssh:连接到主机 192.168.1.153 端口 22:连接被拒绝致命:远端意外挂断
  • 不,我的意思是你可以使用 ssh 登录服务器:ssh sonya@192.168.1.153。如果没有尝试使用调试ssh -vvv sonya@192.168.1.153 获取更多信息
  • 我试过你说的。响应如下。我不知道为什么会发生这种情况,因为我是 linux 的新手。 sonya@sonya-desktop:~/workspace$ ssh -vvv sonya@192.168.1.153 OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 2012 年 3 月 14 日 debug1:读取配置数据 /etc/ssh/ssh_config debug1: /etc/ ssh/ssh_config 第 19 行:为 * debug2 应用选项:ssh_connect:needpriv 0 debug1:连接到 192.168.1.153 [192.168.1.153] 端口 22。debug1:连接到地址 192.168.1.153 端口 22:连接被拒绝 ssh:连接到主机 192.168 .1.153 端口 22:连接被拒绝
  • 通过 SSH 访问存储库需要在机器上安装并运行 SSH 守护程序。情况似乎并非如此——该消息仅表示该 IP 地址上没有 SSH 服务器响应。

标签: git


【解决方案1】:

使用which sshd。 如果命令没有给出sshd的任何路径。你必须安装这个。要在你的服务器机器上安装open ssh,请使用sudo apt-get install openssh-server

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-10-11
    • 2011-04-23
    • 2021-09-13
    • 2017-11-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-08
    相关资源
    最近更新 更多