github 오류 - Permission denied (publickey)

2014. 9. 17. 01:00CM/Github

반응형

상황설명


이클립스에서 하둡소스를 코딩하고 github에 명령어로 소스를 올려보려고 하였다..하지만 문제에 봉착!! 오류는 아래와 같았다.



오류내역

$ git push -u hadoopOrigin master

Permission denied (publickey).

fatal: Could not read from remote repository. 



해결방법


1) 아래의 사이트에서 확인해보니 ssh문제였다..


https://help.github.com/articles/error-permission-denied-publickey


2) ssh를 생성해자~ssh-keygen~! gogo~!


ssh-keygen -t rsa -C "git login id(e-mail address)"


ssh-keygen -t rsa -C "acetxxxx@hanmail.net"

Generating public/private rsa key pair.

Enter file in which to save the key (/Users/AceT/.ssh/id_rsa): 

Enter passphrase (empty for no passphrase): 

Enter same passphrase again: 

Your identification has been saved in /Users/AceT/.ssh/id_rsa.

Your public key has been saved in /Users/AceT/.ssh/id_rsa.pub.

The key fingerprint is:

f9:a2:b7:d1:0a:24:8------------:3c:1a:05 acetaeha@hanmail.net

The key's randomart image is:

+--[ RSA 2048]----+

|   E             |

|. . .            |

|o+ . .           |

|+o+ o    .       |

|.o.o.=. S        |

|   .*o.  o       |

|   . .. o o      |

|       o.+       |

|      ..o.       |

+-----------------+


3) 하둡 설치때와 동일하게 public key를 복사하자!

/Users/AceT/.ssh/id_rsa.pub 의 내용 복사!


4) https://github.com/settings/ssh  로 가서 셋팅 해주면 된다!

  - Settings을 눌러보시면 SSH관련 메뉴가 좌측에 나옵니다.


 - Add an SSH Key : 조금전에 복사한 키값을 아래처럼 넣어주시면 됩니다. 




 5) 확인

$ ssh -T git@github.com

Hi acetaeha! You've successfully authenticated, but GitHub does not provide shell access.


 6) 다시 push해보면 잘되어집니다.

$ git push -u hadoopOrigin master

Counting objects: 3, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (2/2), done.

Writing objects: 100% (3/3), 275 bytes | 0 bytes/s, done.

Total 3 (delta 0), reused 0 (delta 0)

To git@github.com:acetaeha/hadoopStudy.git

 * [new branch]      master -> master

Branch master set up to track remote branch master from hadoopOrigin.


6) 결과




 - END -


반응형