git
› Pro Git
› Atlassian Git Tutorial
› Pro Git 简体中文翻译
› GitX
xingshu
V2EX  ›  git

Gogs git clone 问题

  •  
  •   xingshu · Sep 29, 2018 · 3894 views
    This topic created in 2960 days ago, the information mentioned may be changed or developed.

    Gogs 安装没有问题,访问也没有问题 http://1.2.3.4:3000 正常访问

    使用 http 方式 clone 和 push 都正常

    使用 git clone 时候提示没有权限,网上搜索了好多还是没有摸到诀窍

    我在 http://1.2.3.4:3000/user/settings/ssh 个人页面已经添加了 笔记本电脑的 id_rsa.pub

    但是不能 git clone

    git clone [email protected]:xingshu/aaaaa.git Cloning into 'aaaaa'... [email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic). fatal: Could not read from remote repository.

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

    网上说需要另外再建一个公钥

    请教正确操作方法

    谢谢

    11 replies  •  2019-12-04 12:35:14 +08:00
    shalk
    shalk
    Sep 29, 2018 via iPhone
    1
    感觉是你端口不对,你看看页面上的 ssh 协议的地址
    liwufan
    liwufan
    Sep 29, 2018 via iPad
    2
    大概连接的是服务器 sshd 监听的端口,而不是 gogs 监听的端口
    xingshu
    xingshu
    OP
    Sep 29, 2018
    3
    端口都是默认的 22 啊
    WispZhan
    WispZhan
    Sep 29, 2018
    4
    你确定 你的 ssh-agent 打开了 并且 添加了你的私钥?
    xingshu
    xingshu
    OP
    Sep 30, 2018
    5
    @WispZhan 私钥??

    应该是公钥吧。。
    xingshu
    xingshu
    OP
    Sep 30, 2018
    6
    看了官方的内容
    https://discuss.gogs.io/t/how-to-config-ssh-settings/34


    依旧没有解决。。。。
    WispZhan
    WispZhan
    Sep 30, 2018
    7
    @xingshu 自己试试再说。ssh-add 私钥 ,并且检查 ssh-agent 开启没
    xingshu
    xingshu
    OP
    Sep 30, 2018
    8
    @WispZhan 貌似不行。。。
    KIMMG
    KIMMG
    Oct 7, 2018
    9
    端口问题,去 gogs 看一下监听的端口号是什么,如果是 22,建议修改成别的。22 是你部署服务器的 ssh 端口。你的 clone 操作应该去请求 gogs,而不是服务器的 ssh。
    所以才会有权限的问题
    xingshu
    xingshu
    OP
    Oct 8, 2018
    10
    搞定了。。

    目前权限问题。
    aogg
    aogg
    Dec 4, 2019
    11
    @xingshu 同样问题,同样报错。
    请教,具体是什么权限问题,怎么解决的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   930 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 20:10 · PVG 04:10 · LAX 12:10 · JFK 15:10
    ♥ Do have faith in what you're doing.