Forum Stats

  • 3,837,263 Users
  • 2,262,245 Discussions
  • 7,900,240 Comments

Discussions

Permission Denied errors for devops project oracle cloud git push -f origin main

User_CH508
User_CH508 Member Posts: 2 Green Ribbon

When running the following command...

git push -f origin main

I am receiving below error... They keys have been generated and api key has been created for user account with public key...


[email protected]: Permission denied (publickey).

fatal: Could not read from remote repository.


Config file is in .ssh directory with correct entries..

Am I missing something? Any help would be greatly appreciated... Trying to do VisionStays Developer lab from OCI have followed all steps verbatim and it does not work and there are no support options...

Answers

  • Hi, you may want to check your key permissions and owner, i.e.

     chown $USER ~/.ssh/YOUR-PRIVATE-KEY.pem

     chmod 600 ~/.ssh/YOUR-PRIVATE-KEY.pem

     ssh-add ~/.ssh/YOUR-PRIVATE-KEY.pem

     if you get an error that you can't connect to the agent:

    eval `ssh-agent -s`


    Finally it's a good idea to check your .ssh/config as well:

     chown $USER ~/.ssh/config

     chmod 600 ~/.ssh/config


    Hope this helps