Google Compute Engine에서 Bitnami를 통해 VM을 만들었습니다. 이전에는 Bitnami 웹 인터페이스를 통해 ssh를 사용할 수있었습니다. Mac에서 터미널을 통해 ssh를 시도했지만 Permission denied (publickey)
오류가 계속 발생했습니다. 그런 다음 서버와 Mac의 모든 키를 삭제하고 bitnami에서 pem 파일을 다운로드하고 -i
연결 옵션을 사용했지만 여전히 문제가 지속됩니다.
ssh -i bitnami-gce.pem xxx@1xx.1xx.5x.1xx -v
완전한 디버그 정보 :
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to 1xx.1xx.5x.1xx [1xx.1xx.5x.1xx] port 22.
debug1: Connection established.
debug1: identity file bitnami-gce.pem type -1
debug1: identity file bitnami-gce.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Debian-4~bpo70+1
debug1: match: OpenSSH_6.6.1p1 Debian-4~bpo70+1 pat OpenSSH*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA <RSA KEY>
debug1: Host '1xx.1xx.5x.1xx' is known and matches the RSA host key.
debug1: Found key in /Users/xxx/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: bitnami-gce.pem
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).
호스트에 ssh 할 수 없습니다. 이제 서버에 키를 보낼 수 없습니다. 이 문제를 해결하는 방법?
편집 : Google 웹 콘솔을 통해 ssh를 시도했지만 할 수있었습니다. 누구든지 어디서나 ssh하는 정확한 단계를 말해 줄 수 있습니까? 간단한 사용자 이름과 암호 방식을 선호합니다. 어떻게 구성합니까?
답변
Google 웹 콘솔을 통해 ssh를 수행 한 후 다음 단계를 수행하여이 문제를 해결했습니다.
-
를 사용하여 SSH 키 생성
ssh-keygen
-
key.pub 파일 내용 복사
-
내용을
~/.ssh/authorized_keys
파일에 추가sudo nano ~/.ssh/authorized_keys
답변
인스턴스가 처음 생성되면 기본적으로 SSH 키가 없어 지므로 예를 들어이 SO 답변에gcloud
설명 된대로 처음 연결하는 데 사용 하거나 수동으로 SSH 키를 생성하여이를 전송해야합니다. 다른 SO 답변에 설명 된대로 인스턴스에 수동으로 추가합니다 .
답변
사용자 때문에 같은 상황에 직면했습니다. Google 웹에서 사용자 이름이 내 이메일의 첫 부분을 표시했습니다. 그래서 나는 이렇게 ssh를 시도하고 있었다
ssh <first_part_of_gmail>@google_vm_external_ip
나중에 Google은 Google vm 설정에 넣은 ssh 키를 기반으로 사용자를 만듭니다. 따라서 먼저 공개 키 끝에서 사용자를 확인하고 다음을 시도하십시오.
ssh <user_name_at_the_end_of_public_key>@google_vm_external_ip
답변
같은 문제가 있었는데 gcloud 명령을 사용하여 처음으로 로그인하여 “/ etc / ssh / sshd_config”에 추가했습니다.
PubkeyAcceptedKeyTypes +ssh-dss
systemctl 다시 시작 sshd
답변
오래된 질문이지만 오늘도이 문제가 있었고 다음 단계에 따라 문제를 해결했습니다.
- 로컬 컴퓨터에서 ssh 공개 키 생성
- 공개 키를 gcc 가상 머신 설정에 복사
그런 다음 연결하십시오.
이 단계는 ssh : https://nabtron.com/gcc-mac-terminal/을 사용하여 mac os 터미널에서 gcc vm 인스턴스에 연결하도록 안내 하고 권한 거부 문제 (pubilckey)도 해결합니다.
도움이 되길 바랍니다.
답변
bitnami-gce.pem 권한이 600인지 확인해야합니다.
chmod 600 bitnami-gce.pem 시도
아흐메드를 안다