V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
xingshu
V2EX  ›  git

Gogs git clone 问题

  •  
  •   xingshu · Sep 29, 2018 · 3433 views
    This topic created in 2777 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
        1
    shalk  
       Sep 29, 2018 via iPhone
    感觉是你端口不对,你看看页面上的 ssh 协议的地址
    liwufan
        2
    liwufan  
       Sep 29, 2018 via iPad
    大概连接的是服务器 sshd 监听的端口,而不是 gogs 监听的端口
    xingshu
        3
    xingshu  
    OP
       Sep 29, 2018
    端口都是默认的 22 啊
    WispZhan
        4
    WispZhan  
       Sep 29, 2018
    你确定 你的 ssh-agent 打开了 并且 添加了你的私钥?
    xingshu
        5
    xingshu  
    OP
       Sep 30, 2018
    @WispZhan 私钥??

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


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

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