質問編集履歴

3

ipアドレスが入ってしまっていた

2018/01/01 14:56

投稿

if_dap
if_dap

スコア7

test CHANGED
File without changes
test CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
 
28
28
 
29
- The authenticity of host 'ec2-18-217-7-231.us-east-2.compute.amazonaws.com (18.217.7.231)' can't be established.
29
+ The authenticity of host 'ecx-xx-xxx-xxxx.us-east-2.compute.amazonaws.com ()' can't be established.
30
30
 
31
31
 
32
32
 
@@ -38,9 +38,9 @@
38
38
 
39
39
 
40
40
 
41
- Warning: Permanently added 'ec2-18-217-7-231.us-east-
41
+ Warning: Permanently added 'ecx-xx-xxx-xxxx.us-east-
42
42
 
43
- 2.compute.amazonaws.com,18.217.7.231' (ECDSA) to the list of known hosts.
43
+ 2.compute.amazonaws.com,' (ECDSA) to the list of known hosts.
44
44
 
45
45
 
46
46
 

2

-v

2018/01/01 14:56

投稿

if_dap
if_dap

スコア7

test CHANGED
File without changes
test CHANGED
@@ -87,3 +87,81 @@
87
87
  Warning: Permanently added 'ecx-xx-xxx-x-xxx.us-east-2.compute.amazonaws.com,xx.xxx.x.xxx' (ECDSA) to the list of known hosts.
88
88
 
89
89
  Permission denied (publickey).
90
+
91
+
92
+
93
+ ## 追記2
94
+
95
+ -vをつけて実施してみました。
96
+
97
+ ```
98
+
99
+ OpenSSH_6.9p1, LibreSSL 2.1.8
100
+
101
+ debug1: Reading configuration data /etc/ssh/ssh_config
102
+
103
+ debug1: /etc/ssh/ssh_config line 21: Applying options for *
104
+
105
+ debug1: Connecting to ec2-xx-xxx-x-xxx.us-east-2.compute.amazonaws.com [18.217.7.231] port 22.
106
+
107
+ debug1: Connection established.
108
+
109
+ debug1: permanently_set_uid: 0/0
110
+
111
+ debug1: key_load_public: No such file or directory
112
+
113
+ debug1: identity file /Users/user/.ssh/WordPress.pem type -1
114
+
115
+ debug1: key_load_public: No such file or directory
116
+
117
+ debug1: identity file /Users/user/.ssh/WordPress.pem-cert type -1
118
+
119
+ debug1: Enabling compatibility mode for protocol 2.0
120
+
121
+ debug1: Local version string SSH-2.0-OpenSSH_6.9
122
+
123
+ debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8
124
+
125
+ debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8 pat OpenSSH_6.6.1* compat 0x04000000
126
+
127
+ debug1: Authenticating to ec2-xx-xxx-x-xxx.us-east-2.compute.amazonaws.com:22 as 'ec2-user'
128
+
129
+ debug1: SSH2_MSG_KEXINIT sent
130
+
131
+ debug1: SSH2_MSG_KEXINIT received
132
+
133
+ debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none
134
+
135
+ debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none
136
+
137
+ debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
138
+
139
+ debug1: Server host key: ecdsa-sha2-nistp256 SHA256:grG8qBfR/TRD76KSsKTAhK5/5xYkWg8eIdIDztdTqhI
140
+
141
+ debug1: Host 'ecx-xx-xxx-x-xxx.us-east-2.compute.amazonaws.com' is known and matches the ECDSA host key.
142
+
143
+ debug1: Found key in /var/root/.ssh/known_hosts:1
144
+
145
+ debug1: SSH2_MSG_NEWKEYS sent
146
+
147
+ debug1: expecting SSH2_MSG_NEWKEYS
148
+
149
+ debug1: SSH2_MSG_NEWKEYS received
150
+
151
+ debug1: SSH2_MSG_SERVICE_REQUEST sent
152
+
153
+ debug1: SSH2_MSG_SERVICE_ACCEPT received
154
+
155
+ debug1: Authentications that can continue: publickey
156
+
157
+ debug1: Next authentication method: publickey
158
+
159
+ debug1: Trying private key: /Users/user/.ssh/WordPress.pem
160
+
161
+ debug1: Authentications that can continue: publickey
162
+
163
+ debug1: No more authentication methods to try.
164
+
165
+ Permission denied (publickey).
166
+
167
+ ```

1

追記

2017/12/31 06:05

投稿

if_dap
if_dap

スコア7

test CHANGED
File without changes
test CHANGED
@@ -61,3 +61,29 @@
61
61
 
62
62
 
63
63
  権限を600に変えてみてもうまくいかず、お手上げ状態です。アドバイスをいただけると嬉しいです。
64
+
65
+
66
+
67
+ ## 追記
68
+
69
+ 回答を受けて、インスタンスのキーペア名の箇所が`-`になっていることに気づき、もう一度インスタンスとキーペアを作成仕直し、作成したキーペアを指定してインスタンスのキーペア名が表示されていることを確認しました。
70
+
71
+ ![イメージ説明](ffccce0e604c8b8b7b971d03606d51b6.png)
72
+
73
+
74
+
75
+ その後ssh接続をしようとしたところ、また同じようなエラーが...
76
+
77
+
78
+
79
+ $ sudo ssh -i "/Users/user/.ssh/WordPress.pem" ec2-user@ecx-xx-xxx-x-xxx.us-east-2.compute.amazonaws.com
80
+
81
+ The authenticity of host 'ec2-xx-xxx-x-xxx.us-east-2.compute.amazonaws.com (xx.xxx.x.xxx)' can't be established.
82
+
83
+ ECDSA key fingerprint is SHA256:grG8qBfR/TRD76KSsKTAhK5/5xYkWg8eIdIDztdTqhI.
84
+
85
+ Are you sure you want to continue connecting (yes/no)? yes
86
+
87
+ Warning: Permanently added 'ecx-xx-xxx-x-xxx.us-east-2.compute.amazonaws.com,xx.xxx.x.xxx' (ECDSA) to the list of known hosts.
88
+
89
+ Permission denied (publickey).