Permission denied when clicking file on remote

I previously used git bash for a local repository.
I connected to my GitHub account and I always made files without problems.
Later I will remove bash and set the new user and email address again. Now, when I try to push the file to the remote, I got an error:

 Permission to SyedMiraj/SpringSecurityWithTicketBooking.git denied to biid-sua.
 unable to access 'https://github.com/SyedMiraj/SpringSecurityWithTicketBooking.git/': The requested URL returned error: 403

I tried to create a new SSH key and add it to the remote repo.
But the problem still exists and, in truth, I can’t direct anything to my remote.
My two GitHub accounts are Bid Sua and Rejuvenation.

How would you suggest restoring GitHub?

+1
source share
2 answers

A few points here:

  • , , ( GitHub)
  • SSH- ( ) GitHub URL- https.
    biid-sua, git, biid-sua github.com.

( Mac, Windows). /.

swtich URL SSH:

cd /path/to/my/local/repo
git remote set-url origin g2:SyedMiraj/SpringSecurityWithTicketBooking.git

, ~/.ssh/config g2 ( )

#Account one
Host g1
    HostName github.com
    PreferredAuthentications publickey
    IdentityFile /c/Users/yourname/.ssh/id_rsa_biid-sua
    User git

#Account two
Host g2
    HostName github.com
    PreferredAuthentications publickey
    IdentityFile /c/Users/yourname/.ssh/id_rsa_smiraj
    User git

, SSH- HOME:

  • .ssh/id_rsa_biid-sua .ssh/id_rsa_biid-sua.pub
  • .ssh/id_rsa_smiraj .ssh/id_rsa_smiraj.pub
+2

ssh:

0

Source: https://habr.com/ru/post/1692626/


All Articles