AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 832899
Accepted
Shailesh Sutar
Shailesh Sutar
Asked: 2017-02-17 03:17:01 +0800 CST2017-02-17 03:17:01 +0800 CST 2017-02-17 03:17:01 +0800 CST

https git clone 和 ssh git clone 的区别

  • 772

嗨,我现在使用 git 有一段时间了,但是我是企业 git 的新手。这是我对我所做的事情,test-repo我创建了一个 ssh 密钥对并将公钥添加到我的测试存储库中作为部署密钥。现在我可以克隆我test-repo的来源ssh,https但是当我将某人添加为协作者时,他们可以从中克隆 repo,https但不能从ssh

ssh-keygen -b 4096 -t rsa -f example_rsa -P "" -C ""

$ ls
example_rsa     example_rsa.pub

$ git clone [email protected]:star/test-repo.git
Cloning into 'test-repo'...
Warning: Permanently added the ECDSA host key for IP address '10.0.1.100' to the list of known hosts.
warning: You appear to have cloned an empty repository.

即使在通过 ssh 授予访问权限后,用户也无法访问相同的 git 存储库,但是用户可以使用 git 克隆存储库https。

git clone [email protected]:star/test-repo.git
Cloning into 'test-repo'...
Permission denied (publickey).
fatal: Could not read from remote repository.

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

git clone https://git.example-private.com/star/test-repo.git
Cloning into 'test-repo'...
warning: You appear to have cloned an empty repository.
ssh https git ssh-keys ubuntu-14.04
  • 1 1 个回答
  • 20298 Views

1 个回答

  • Voted
  1. Best Answer
    13dimitar
    2017-02-17T03:30:28+08:002017-02-17T03:30:28+08:00

    Git 使用多种协议进行客户端-服务器通信:

    • http
    • https
    • SSH
    • 混帐

    当您决定使用sshgit 服务器时,您需要为将使用您的存储库的协作者提供相关的 ssh 访问权限。有很多解决方案可以简化管理 - gitlab(它也有 GUI)、gitolite 和许多其他解决方案。Git 甚至带有一个git-shell- 如果你将它设置为一个新创建的用户,他将只能使用 git,而不能 ssh 进入服务器。使用ssh更安全,是企业环境更好的解决方案(我认为)。

    当您使用 https 作为传输协议时,您将获得 https 的优势(或限制)。当您的 git 服务器(例如 cgit)有一个 Web 界面并且它允许用户克隆存储库(但不能推送)时,它最常使用。

    请看一下这个——关于 Git 中使用的协议的详细解释。

    • 3

相关问题

  • 如何最好地设置 ssh 隧道以访问远程网络 (Linux)

  • SSH 和重定向

  • 通过 SSH 会话使用 NET USER 命令拒绝访问

  • SSH 服务器零日漏洞利用 - 保护自己的建议

  • ubuntu apt-get upgrade - 如何在 shell 中单击确定?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve