以前作ったものを同じPCではあるのですが一度決してしまっており、gitからcloneしたものをデプロイしようとしてEC2にログインしようといつもどうりsshで起動しようとすると
ユーザー$ ssh -i keyname ec2-user@<ipアドレス> Permission denied (publickey)
という状態で弾かれてしまい、ずっとこのエラーで止まってます
WARNING: UNPROTECTED PRIVATE KEY FILE! ではないので誰でも編集可能な状態ではないのですが
、色々と調べて
ec2-userの部分が変わっていたのかと思い別の admin,root,centosなども入れてみましたが、変わりありませんでした
一応当時のインタンスIDとIPアドレスは一旦解放して、新規で作成しました
(base) username:.ssh username$ ssh -vT git@github.com OpenSSH_7.9p1, LibreSSL 2.7.3 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 48: Applying options for * debug1: Connecting to github.com port 22. debug1: Connection established. debug1: identity file /Users/username/.ssh/id_rsa type 0 debug1: identity file /Users/username/.ssh/id_rsa-cert type -1 debug1: identity file /Users/username/.ssh/id_dsa type -1 debug1: identity file /Users/username/.ssh/id_dsa-cert type -1 debug1: identity file /Users/username/.ssh/id_ecdsa type -1 debug1: identity file /Users/username/.ssh/id_ecdsa-cert type -1 debug1: identity file /Users/username/.ssh/id_ed25519 type -1 debug1: identity file /Users/username/.ssh/id_ed25519-cert type -1 debug1: identity file /Users/username/.ssh/id_xmss type -1 debug1: identity file /Users/username/.ssh/id_xmss-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_7.9 debug1: Remote protocol version 2.0, remote software version babeld-d48c3acd debug1: no match: babeld-d48c3acd debug1: Authenticating to github.com:22 as 'git' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: rsa-sha2-512 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8 debug1: Host 'github.com' is known and matches the RSA host key. debug1: Found key in /Users/username/.ssh/known_hosts:1 debug1: rekey after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey after 134217728 blocks debug1: Will attempt key: /Users/username/.ssh/id_rsa RSA SHA256:EEPRVYIS243vMV3TcxeHEfBMlwf52L3VJYlE9ioAF4I agent debug1: Will attempt key: /Users/username/.ssh/id_dsa debug1: Will attempt key: /Users/username/.ssh/id_ecdsa debug1: Will attempt key: /Users/username/.ssh/id_ed25519 debug1: Will attempt key: /Users/username/.ssh/id_xmss debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss> debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering public key: /Users/username/.ssh/id_rsa RSA SHA256:EEPRVYIS243vMV3TcxeHEfBMlwf52L3VJYlE9ioAF4I agent debug1: Server accepts key: /Users/username/.ssh/id_rsa RSA SHA256:EEPRVYIS243vMV3TcxeHEfBMlwf52L3VJYlE9ioAF4I agent debug1: Authentication succeeded (publickey). Authenticated to github.com ([52.69.186.44]:22). debug1: channel 0: new [client-session] debug1: Entering interactive session. debug1: pledge: network debug1: Sending environment. debug1: Sending env LANG = ja_JP.UTF-8 debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 Hi GITHUB名! You've successfully authenticated, but GitHub does not provide shell access. debug1: channel 0: free: client-session, nchannels 1 Transferred: sent 3452, received 2484 bytes, in 0.4 seconds Bytes per second: sent 8077.7, received 5812.6 debug1: Exit status 1
とsshがあることは
debug1: Connecting to github.com port 22.
debug1: Connection established.
でわかるのですが、それが承認されていません
lsの中身も
設定してある.pem id_rsa id_rsa.pub known_hosts
で一応あります
https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html#TroubleshootingInstancesConnectingSSH
↑参考にしたAWSサイト
AWSの公式のとうりにインスタンス停止後、IPアドレス確認、インスタンスID確認、デタッチ、バージョン変更、アタッチ、インスタンス開始、で確認はしましたが、変わりませんでした
最終的にはポートフォリオ用としてデプロイをしたいので助けてもらいたいです。
追記 3/24 sshの versionは OpenSSH_7.9p1, LibreSSL 2.7.3 です
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/03/24 03:44
2020/03/24 03:46
2020/03/24 03:48
2020/03/24 04:10 編集
2020/03/24 04:24
2020/03/25 18:31
2020/03/26 02:06
2020/03/26 06:15
2020/03/26 06:31