2014-12-08 2 views
3

배포 키를 사용하여 원격 EC2 우분투 인스턴스에 저장소를 복제 할 수 없습니다. 다음 단계는 다음과 같습니다. 배포 키 (bitbucket)를 사용하여 복제 할 수 없습니다. EC2

  1. 내가 내가 내가 these steps 다음 내 새 키를 생성
  2. https://stackoverflow.com/a/26520681/808734 다음 ~/.ssh/know_hosts을 청소하고 REPO에 deployment key로 추가 내의 bitbucket 계정
  3. 에 있던 기존 배포 키를 삭제. 여기
  4. ssh -T [email protected]

    You can use git or hg to connect to Bitbucket. Shell access is disabled. This deploy key has read access to the following repositories: username/repository: KEYNAME -- [email protected]

  5. 의 출력 그러나 나는
    sudo git clone [email protected]:username/repository.git 내가 Cloning into 'repository'... Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

내가 여기서 뭔가를 놓치고 다음과 같은 오류를 얻을 저장소를 복제 할 때 ? 아무도 조언 있니?

읽어 주셔서 감사합니다.

답변

9

글쎄, 당황 스럽네요, 여기서 문제는 sudo 사용자로 명령을 실행하고 있다는 것입니다.

sudo git clone [email protected]:username/repository.git 

이것은 루트 사용자로 저장소를 복제하여 오류를 일으키는 것일 수 있습니다. 그러나 현재 사용자로 복제하고 필수 디렉토리에 쓰기 권한을 제공하면 저장소를 성공적으로 복제 할 수 있습니다.

내 ssh 키가 재설정 된 것처럼 보였습니다 따라서 ssh -T [email protected]이 예상대로 작동하는지 확인하십시오. 그렇지 않은 경우 실행하면

# start the ssh-agent in the background 
eval "$(ssh-agent -s)" 
# Agent pid 59566 
ssh-add ~/.ssh/id_rsa 

이 근무했습니다. more details

+1

'ssh-add' saved me. 새 키를 만들고 그것을 시도한 후에도 수동으로'ssh-add'를 추가해야했습니다. 잘 했어! – Aarmora

+0

와아! 그게 그랬어!, 문제가 아니라면 진짜 문제가 무엇인지,이 코드는 무엇을했는지 알려주시겠습니까? – BlackBurn027

1
fatal: Could not read from remote repository. 
Please make sure you have the correct access rights and the repository exists. 

은 많은 GIT 사용자에게 재발하는 문제인 것처럼 보입니다.

올바른 사용자 이름과 URL을 사용하십시오!

git: fatal: Could not read from remote repository이 도움이 될 수 있습니다.

Goodluck!

0

당신은 팀의 일원 및 저장소를 복제하려고 다음

SSH에서 URL을

즉 약간 변경해야 할 수도 있습니다 경우 : //[email protected] : //[email protected] / TEAM_NAME/repo_name : TEAM_NAME 팀/

SSH에

을 repo_name.git.git

관련 문제