2016-09-24 3 views
1

"git/ssh 작업에서 '거부 된 권한이 있습니다. 어떻게해야합니까?'라는 질문이 있는데, 필요한 경우 대답이 키를 생성하고 에이전트에 추가 한 다음 사용자와 연관시킵니다. Github/Bitbucket/etc 계정. 나는 그걸로 모든 설정 ... 제 질문은 내가 먼저 "허가 거부"오류에 대해 걱정할 필요가 무엇입니까? 일어난 문제를 해결하기 위해 필요한 조치가 있습니까?(github) "permission denied (publickey)"가 시작되었습니다. 고쳐서 ... 추가 조치를 취해야합니까?

다음은 이야기입니다. 나는 행복하게 일하며 오랫동안 지속 되어온 프로젝트에 종사하고 있습니다. 나는 기스 터에 대한 소유주입니다 ... 그리고 나서 나는 밀어 낼 수 없었습니다. 나는 (SourceTree를 통해) "permission denied (public key)"라는 문자열을 반복해서 가지고있다.

ls ~/.ssh 보여줍니다 github_rsa, github_rsa.pub, id_rsaid_rsa.pub : 그래서 디버깅을 시작했다. ssh-add -l [-E md5] 모두 준 나에게

ssh -vT [email protected]The agent has no identities.했다 (이것은 OSX 10.11입니다)

... 
debug1: identity file /Users/---/.ssh/id_rsa type 1 
debug1: key_load_public: No such file or directory 
debug1: identity file /Users/---/.ssh/id_rsa-cert type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /Users/---/.ssh/id_dsa type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /Users/---/.ssh/id_dsa-cert type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /Users/---/.ssh/id_ecdsa type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /Users/---/.ssh/id_ecdsa-cert type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /Users/---/.ssh/id_ed25519 type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /Users/---/.ssh/id_ed25519-cert type -1 
... 
Host 'github.com' is known and matches the RSA host key. 
Found key in /Users/---/.ssh/known_hosts:1 
... 
debug1: Authentications that can continue: publickey 
debug1: Next authentication method: publickey 
debug1: Offering RSA public key: /Users/---/.ssh/id_rsa 
debug1: Authentications that can continue: publickey 
debug1: Trying private key: /Users/---/.ssh/id_dsa 
debug1: Trying private key: /Users/---/.ssh/id_ecdsa 
debug1: Trying private key: /Users/---/.ssh/id_ed25519 
debug1: No more authentication methods to try. 
Permission denied (publickey). 

ssh-add ~/.ssh/id_rsa하고 고정 된 새로운 Github의 키로 id_rsa.pub를 추가.

하지만 처음에는 문제가 있다는 사실이 걱정스러운 것 같습니다. 나는 어제 잘 연결할 수 있었다. 나는 어떤 방식 으로든 타협 되었는가? 내가 무엇인가 더해야합니까, 아니면 내가 다시 연결할 수있어서 행복할까요?

답변

0

어제는 이 (가) ssh-agent에 있었는데 어떻게 든 제거 되었나요? 당신의 ~/.ssh/config

  • ssh-add ~/.ssh/github_rsa

또는

IdentityFile ~/.ssh/github_rsa 퍼팅
  • 이렇게하면 심지어 github의 계정에서 id_rsa.pub 제거하여 문제를 해결해야한다.

    그러나 어떤 파일이 아니라면 컴퓨터에 어떻게 나타나는지 잘 모르는 경우가 아니면 id_rsa을 사용하는 것이 좋습니다. 이 경우 사용하지 말고 이전 버전으로 돌아가거나 새 버전을 생성하십시오 (컴퓨터가 실제로 손상된 경우).

+0

'github_rsa'에 대해 이해가 가는데, 이제는 내가 왜 그걸로 가지 않았는지 잘 모르겠다. 그래서 당신의 감각은 "어떻게 든 제거 됐습니다"부분에 대해 걱정할 필요가 없다는 것입니다. 일하는 것과 일하지 않는 것 사이의 시간에, 내 컴퓨터는 잠 들어 집에 아무도없는 집에 잠 들어있었습니다. _ 무엇인가 _ 일어 났음에 틀림 없다 _ – henry

관련 문제