GitHub Error Message - Permission denied (publickey)

后端 未结 30 2238
长发绾君心
长发绾君心 2020-11-22 04:23

Anybody seen this error and know what to do?

I\'m using the terminal, I\'m in the root, the GitHub repository exists and I don\'t know what to do now.



        
30条回答
  •  太阳男子
    2020-11-22 05:22

    I was having a similar problem to @Batman. However, because I was running this under /usr/local/src/projectname, running without sudo was not an option.

    Just add the -E flag to preseve the environment (your ~/.ssh/ path).

    $ sudo -E git clone git@your_repo

    From man sudo:

    -E, --preserve-env Indicates to the security policy that the user wishes to pre‐ serve their existing environment variables. The security policy may return an error if the user does not have permis‐ sion to preserve the environment.

提交回复
热议问题