2017-09-20 10 views
1

Google Cloud documentation에 따르면 "compute instance admin"역할이있는 프로젝트 멤버 인 경우 gcloud 도구를 사용하여 프로젝트의 모든 인스턴스에 연결할 수 있어야합니다.gcloud compute ssh returns Permission Denied (publickey)

Google Cloud Console의 프로젝트 IAM 페이지에서 "Compute Instance Admin (v1)"역할을 사용하는 사용자 이름을 명시 적으로 추가했지만 아직 일부 자동화에서 만든 인스턴스에 연결할 수 없습니다.

[username]:~/src/infrastructure$ gcloud compute ssh [instance id] 
Unauthorized use is strictly prohibited. All access and activity 
is subject to logging and monitoring. 
Permission denied (publickey). 
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255]. 

내가 연결할 수있는 유일한 인스턴스는 저에 의해 만들어진 것입니다.

무엇이 잘못 될 수 있습니까?

부수적으로, this documentation에 따르면 인스턴스에 수동으로 RSA 공개 키를 추가 한 다음 SSH를 사용하여 연결할 수 있어야합니다.

내 공개 키를 ~/.ssh/google_compute_engine.pub에서 인스턴스 메타 데이터에 추가 한 다음 SSH를 사용하여 시도했지만 행운이 없습니다.

[username]:~/src/infrastructure$ ssh -i ~/.ssh/google_compute_engine [public ip of instance] 
Unauthorized use is strictly prohibited. All access and activity is subject to logging and monitoring. 
Received disconnect from 35.197.127.143 port 22:2: Too many authentication failures for matts 
Connection to 35.197.127.143 closed by remote host. 
Connection to 35.197.127.143 closed. 

Google에서 권장하는 것처럼 인스턴스 액세스를 위해 SSH 키를 수동으로 관리하고 싶지 않습니다. 나는 gcloud compute ssh이 작동하기를 원하기 때문에이 두 번째 실패에 초점을 맞추기보다는 첫 번째 오류에 초점을 맞 춥니 다 (관련되지 않은 경우).

+0

이 [문서] (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys) 프로세스를 확인하여 [SSH 키] (https://cloud.google)를 업데이트하십시오. .com/compute/docs/instances/연결에서 인스턴스로). 또한 인스턴스에 VM [게스트 환경] (https://github.com/GoogleCloudPlatform/compute-image-packages#guest-overview)이 오래되었을 수도 있습니다. 또한이 [문제 신고] (https://issuetracker.google.com/67997017)를 확인하면 몇 가지 제안이 도움이 될 수 있습니다. [오류 255] (https://issuetracker.google.com/67997017#comment4)는 매우 일반적인 오류입니다. –

답변

1

이 과정 documentation을 참조하여 SSH 키를 업데이트하십시오. 또한 인스턴스가 VM guest environment으로 구식 일 수 있습니다. 또한 issue report을 확인해보십시오. 몇 가지 제안이 도움이 될 수 있습니다. Error 255은 매우 일반적인 오류입니다.