2015-11-30 22 views
5

Tôi nhận được sự cho phép này từ chối sự cố khi tôi muốn ssh tới máy chủ ec2 của mình. Tôi đã thử giải pháp hiện tại chmod 600 "My.pem" nhưng vẫn không hoạt động. Dưới đây là thông tin gỡ lỗi của tôi:EC2 ssh Quyền bị từ chối (khóa công khai, gssapi-keyex, gssapi-with-mic)

debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 21: Applying options for * 
debug1: Connecting to 54.223.47.74 [54.223.47.74] port 22. 
debug1: Connection established. 
debug1: key_load_public: No such file or directory 
debug1: identity file My.pem type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file My.pem-cert type -1 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_6.9 
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1 
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000 
debug1: Authenticating to 54.223.47.74:22 as 'root' 
debug1: SSH2_MSG_KEXINIT sent 
debug1: SSH2_MSG_KEXINIT received 
debug1: kex: server->client [email protected] <implicit> none 
debug1: kex: client->server [email protected] <implicit> none 
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY 
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:tfjxcE5kePSv1cJK7SWBp/56kgm2DQkyPLSLZ4d73Io 
debug1: Host '54.223.47.74' is known and matches the ECDSA host key. 
debug1: Found key in /Users/tan/.ssh/known_hosts:24 
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,gssapi-keyex,gssapi-with-mic 
debug1: Next authentication method: publickey 
debug1: Trying private key: My.pem 
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic 
debug1: No more authentication methods to try. 
Permission denied (publickey,gssapi-keyex,gssapi-with-mic). 
+0

Bạn đang thiết lập làm người dùng SSH? Nó có khớp với người dùng trên máy ec2 không. Nó có lẽ sẽ là 'ubuntu' hoặc' root' –

+0

Tôi nghĩ rằng nó nên là root, máy là redhat 7.1. Tôi đã thử root và ec2-user để ssh, không ai trong số họ thành công. – lawzlo

+0

đăng nhật ký chi tiết hơn. Bạn có thể chỉ định nhiều tùy chọn '-v' hơn trên dòng lệnh. Ngoài ra kiểm tra các lỗi trong nhật ký máy chủ, nếu bạn có bảng điều khiển web. – Jakuje

Trả lời

-1

Soluction trong thiết bị đầu cuối cho lỗi

Permission denied (PublicKey, GSSAPI-keyex, GSSAPI-với-mic, mật khẩu).

ssh-keygen -f " ~/.ssh/known_hosts" -R xx.xx.xxx.xxx 

xx - ip host

http://pastebin.com/YpqGSJ2E

+0

Tôi đã thử cách này và thông báo tương tự lại xuất hiện. – lawzlo

0

tôi giải quyết vấn đề này trong máy centos của tôi bằng cách sử dụng lệnh:

ssh -i <Your.pem> [email protected]<YourServerIP> 

Đó là về userNameec2-user trong trường hợp của tôi.

tham chiếu từ: AMAZONTroubleshooting

1

giải quyết bằng cách kết nối với người sử dụng centos thay vì ec2-user.

0

Kiểm tra xem bạn có ở cùng một thư mục có khóa của bạn không. Tôi gặp sự cố tương tự và đã phát hiện ra rằng đó là biểu mẫu thư mục sai nơi tôi cố gắng kết nối

Các vấn đề liên quan