이 문제는 일반적인 것으로 알고 있지만 제 경우의 원인은 평범하지 않습니다.자신에게 전송 된 개인 키를 사용하여 AWS EC2에 연결할 수 없습니다 (사용 권한 거부 : 공개 키)
내 Mac에서 개인 키를 사용하여 액세스하는 우분투 AWS EC2 인스턴스가 있습니다.
직장에있는 동안 액세스하고 싶기 때문에 내 보관 용 계정에 키를 넣고 내 직장 (창) PC에 다운로드 한 다음 C:/Users/[myusername]/.ssh
디렉토리에 두었습니다. 나는 또한 chmod 600
일 것이다.
SSH를 가지고 있기 때문에 SSH를 사용하고 있으므로 지금은 putty를 설치하고 싶지 않습니다.
그래서 나는 명령
C:\Users\[myusername]\.ssh> ssh -v -i .\key_pair.pem [email protected][redacted].compute.amazonaws.com
실행 여기에
는 출력 (물론 올바른 DNS 이름을.) :OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to [redacted].compute.amazonaws.com [[redacted]] port 22.
debug1: Connection established.
debug1: identity file .\\key_pair.pem type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 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
Warning: Permanently added '[redacted].compute.amazonaws.com,[redacted]' (RSA) to the list of known hosts.
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: C:\\Users\\[myusername]\\.ssh\\github_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: .\\key_pair.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).
나는 확신이 키 I 내 Mac에서 제대로 작동하므로 올바르게 사용되었습니다. 내가 잘못하고있는 다른 것이 있습니까?
편집
: 나는 디버그 출력이 언급주의 사항 :debug1: Offering public key: C:\\Users\\[myusername]\\.ssh\\github_rsa
그것이 관련이없는 공개 키를 제공하는 인증에 영향을 미칠 있다는 사실을합니까?
당신'는/var/log/auth.log'에서 로그 라인이 때 로그인 시도는 무엇을 실패하는? – clement
키 파일의 사용자 이름과 그룹 이름을 클라이언트 시스템의 현재 액세스 사용자로 변경 했습니까? 또한 keyfile 권한을 400으로 변경하고 다시 시도하십시오. – Sathish
UNIX 시스템에없는 것을 감안할 때'var/log' 디렉토리가 있습니까? – harryg