V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
raiz
V2EX  ›  Linux

ubuntu 下 git push origin master, 提示: Access denied. 但是 pull 成功

  •  
  •   raiz · 2015-07-22 15:23:27 +08:00 · 5824 次点击
    这是一个创建于 3208 天前的主题,其中的信息可能已经有所发展或是发生改变。
    ubuntu 下 git push origin master, 提示:

    Access denied.
    fatal: Could not read from remote repository.

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

    仓库是 [email protected]
    公钥已经加入 git@osc
    私钥放在 ~/.ssh/ 下 通过 config 配置 为

    ```
    Host git.oschina.net
    IdentityFile ~/.ssh/id_rsa_osc_myproject
    User myname
    ```

    clone 和 pull 都可以用 成功, 而且同样的配置在 windows 这边 可以 push, 请问哪里不对劲?
    11 条回复    2015-07-23 11:25:15 +08:00
    yangxin0
        1
    yangxin0  
       2015-07-22 15:32:43 +08:00
    你的账户没得写权限
    raiz
        2
    raiz  
    OP
       2015-07-22 15:37:30 +08:00
    @yangxin0 权限是 drwxrwxrwx 1 root root 4096 用的是root账号
    Valyrian
        3
    Valyrian  
       2015-07-22 16:04:58 +08:00 via iPad
    User不是git?
    raiz
        4
    raiz  
    OP
       2015-07-22 17:02:10 +08:00
    对的 user 我写的不是git , 改为 git 还是一样结果, 问题是 windowd 那个配置文件是一样的就可以 *-*
    ekeyme
        5
    ekeyme  
       2015-07-22 17:12:36 +08:00 via iPhone
    协议会不会不对?想看下你的origin添加时所用的协议是什么,如果是 git://……,就只能pull与clone,
    forcecharlie
        6
    forcecharlie  
       2015-07-22 17:23:54 +08:00
    删了 ~/.ssh/known_hosts 最近攻击较多,用了 高防ip,ip 变化了。
    FifiLyu
        7
    FifiLyu  
       2015-07-22 17:33:41 +08:00
    联系客服问问。多半是服务端存储你的帐号没有写权限。

    我自己服务器是是遇到过这样的错误的,N次。
    raiz
        8
    raiz  
    OP
       2015-07-22 17:42:30 +08:00
    @ekeyme git remote add origin [email protected]:myname/myproject.git 这样添加的
    @forcecharlie 我删过,又测试一次,发现结果一样
    @FifiLyu 我是这样怀疑过,但是 同一个仓库在windows (ubuntu 装在虚拟机里) 这边可以push成功 话说git@osc 客户躲在哪里找不到入口啊
    leefly
        9
    leefly  
       2015-07-22 23:22:24 +08:00
    再重新生成个key吧 注意邮箱还有名字 😌
    raiz
        10
    raiz  
    OP
       2015-07-23 10:49:41 +08:00
    @leefly 换了还是不行, 你有没有 账号, 可以帮我测试一下吗, 新建一个工程,新的 key, 我发现以前添加的key可以用,先新建的不能用了
    raiz
        11
    raiz  
    OP
       2015-07-23 11:25:15 +08:00
    搞定了搞定了,原来 工程单独配置的公钥只能 clone 和 pull, 账号可以可以部署公钥,账号的就是可读可写的。 但是为什么要这样的设定啊?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2349 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 12:27 · PVG 20:27 · LAX 05:27 · JFK 08:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.