質問編集履歴

2

追記

2021/05/16 02:50

投稿

yastinbieber
yastinbieber

スコア49

test CHANGED
File without changes
test CHANGED
@@ -227,3 +227,49 @@
227
227
  EC2
228
228
 
229
229
  AWS
230
+
231
+
232
+
233
+ ### 追記
234
+
235
+ ```
236
+
237
+ $ cd ~
238
+
239
+
240
+
241
+ $ mkdir ~/.ssh
242
+
243
+ # .sshというディレクトリを作成
244
+
245
+ # File existsとエラーが表示されたとしても、.sshディレクトリは存在しているということなので、そのまま進みましょう。
246
+
247
+
248
+
249
+ $ mv Downloads/ダウンロードした鍵の名前.pem .ssh/
250
+
251
+ # mvコマンドで、ダウンロードしたpemファイルを、ダウンロードディレクトリから、.sshディレクトリに移動します。
252
+
253
+
254
+
255
+ $ cd .ssh/
256
+
257
+
258
+
259
+ $ ls
260
+
261
+ # pemファイルが存在するか確認しましょう
262
+
263
+
264
+
265
+ $ chmod 600 ダウンロードした鍵の名前.pem
266
+
267
+
268
+
269
+ $ ssh -i ダウンロードした鍵の名前.pem ec2-user@作成したEC2インスタンスと紐付けたElastic IP
270
+
271
+ #(例えばElastic IPが123.456.789であれば、shh -i ダウンロードした鍵の名前.pem ec2-user@123.456.789 というコマンドになります)
272
+
273
+ #(ダウンロードした鍵を用いて、ec2-userとしてログイン)
274
+
275
+ ```

1

追記

2021/05/16 02:50

投稿

yastinbieber
yastinbieber

スコア49

test CHANGED
File without changes
test CHANGED
@@ -114,12 +114,116 @@
114
114
 
115
115
 
116
116
 
117
-
117
+ なお『詳細を表示』ボタンから確認できる内容は下記となります。
118
+
119
+ ```
120
+
121
+ Used command: /usr/bin/ssh -v -N -S none -o ControlMaster=no -o ExitOnForwardFailure=yes -o ConnectTimeout=10 -o NumberOfPasswordPrompts=3 -i /Users/yastinbieber/Downloads/torekabodymake_keypair.pem -o TCPKeepAlive=no -o ServerAliveInterval=60 -o ServerAliveCountMax=1 -p 22 ec2-user@54.249.173.184 -L 55060:127.0.0.1:3306
122
+
123
+
124
+
125
+ OpenSSH_8.1p1, LibreSSL 2.7.3
126
+
127
+ debug1: Reading configuration data /etc/ssh/ssh_config
128
+
129
+ debug1: /etc/ssh/ssh_config line 47: Applying options for *
130
+
131
+ debug1: Control socket " none" does not exist
132
+
133
+ debug1: Connecting to 54.249.173.184 [54.249.173.184] port 22.
134
+
135
+ debug1: fd 3 clearing O_NONBLOCK
136
+
137
+ debug1: Connection established.
138
+
139
+ debug1: identity file /Users/yastinbieber/Downloads/torekabodymake_keypair.pem type -1
140
+
141
+ debug1: identity file /Users/yastinbieber/Downloads/torekabodymake_keypair.pem-cert type -1
142
+
143
+ debug1: Local version string SSH-2.0-OpenSSH_8.1
144
+
145
+ debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
146
+
147
+ debug1: match: OpenSSH_7.4 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
148
+
149
+ debug1: Authenticating to 54.249.173.184:22 as 'ec2-user'
150
+
151
+ debug1: SSH2_MSG_KEXINIT sent
152
+
153
+ debug1: SSH2_MSG_KEXINIT received
154
+
155
+ debug1: kex: algorithm: curve25519-sha256
156
+
157
+ debug1: kex: host key algorithm: ecdsa-sha2-nistp256
158
+
159
+ debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
160
+
161
+ debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
162
+
163
+ debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
164
+
165
+ debug1: Server host key: ecdsa-sha2-nistp256 SHA256:273QxtYusMEyPX3qA2kiWHOeU2qyePbJKjRbAGdZNFA
166
+
167
+ debug1: Host '54.249.173.184' is known and matches the ECDSA host key.
168
+
169
+ debug1: Found key in /Users/yastinbieber/.ssh/known_hosts:1
170
+
171
+ debug1: rekey out after 134217728 blocks
172
+
173
+ debug1: SSH2_MSG_NEWKEYS sent
174
+
175
+ debug1: expecting SSH2_MSG_NEWKEYS
176
+
177
+ debug1: SSH2_MSG_NEWKEYS received
178
+
179
+ debug1: rekey in after 134217728 blocks
180
+
181
+ debug1: Will attempt key: /Users/yastinbieber/Downloads/torekabodymake_keypair.pem explicit
182
+
183
+ debug1: SSH2_MSG_EXT_INFO received
184
+
185
+ debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
186
+
187
+ debug1: SSH2_MSG_SERVICE_ACCEPT received
188
+
189
+ debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
190
+
191
+ debug1: Next authentication method: publickey
192
+
193
+ debug1: Trying private key: /Users/yastinbieber/Downloads/torekabodymake_keypair.pem
194
+
195
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
196
+
197
+ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @
198
+
199
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
200
+
201
+ Permissions 0644 for '/Users/yastinbieber/Downloads/torekabodymake_keypair.pem' are too open.
202
+
203
+ It is required that your private key files are NOT accessible by others.
204
+
205
+ This private key will be ignored.
206
+
207
+ Load key "/Users/yastinbieber/Downloads/torekabodymake_keypair.pem": bad permissions
208
+
209
+ debug1: No more authentication methods to try.
210
+
211
+ ec2-user@54.249.173.184: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
212
+
213
+ ```
214
+
215
+
216
+
217
+ 恐れ入りますが要因がわかる方ご教示いただけますと幸いです。
118
218
 
119
219
 
120
220
 
121
221
  ### 補足情報(FW/ツールのバージョンなど)
122
222
 
123
-
124
-
125
- ここにより詳細な情報を記載してください。
223
+ Rails 5.2.5
224
+
225
+ ruby 2.5.1
226
+
227
+ EC2
228
+
229
+ AWS