V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
inyfee
V2EX  ›  问与答

在 /var/www 目录下无法git clone ,提示 Permission denied (publickey).

  •  
  •   inyfee · Nov 27, 2013 · 4183 views
    This topic created in 4539 days ago, the information mentioned may be changed or developed.
    我在 /var/www 目录下:
    sudo git clone ........

    提示:
    在 /var/www 目录下无法git clone ,提示 :
    Permission denied (publickey).
    fatal: The remote end hung up unexpectedly


    而在 home 目录 下则可以
    remote: Counting objects: 1990, done.
    remote: Compressing objects: 100% (1652/1652), done.
    remote: Total 1990 (delta 639), reused 1261 (delta 133)
    Receiving objects: 100% (1990/1990), 11.69 MiB | 1.22 MiB/s, done.
    Resolving deltas: 100% (639/639), done.

    请问这是为什么 ?
    3 replies    1970-01-01 08:00:00 +08:00
    zz1956
        1
    zz1956  
       Nov 27, 2013
    chown -R yourname:yourname /var/www
    ceyes
        2
    ceyes  
       Nov 27, 2013   ❤️ 1
    都说了是“Permission denied (publickey).”
    你的用户的 publickey 是添加过去了,但是 root 的应该没有吧
    你的sudo ……
    inyfee
        3
    inyfee  
    OP
       Nov 27, 2013
    @ceyes 对 git 不太熟,原来是这样的原因 ,谢谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2137 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 00:32 · PVG 08:32 · LAX 17:32 · JFK 20:32
    ♥ Do have faith in what you're doing.