キュアセブン技術ブログ

考えたこと,学んだことを書きます

AWSのEC2に作ったcloud9に接続できなくなった

まだAWSがcloud9を導入してない時にdockerで入れたcloud9,URLが無効になった

 

やるべきこと

 

sshでログイン

qiita.comこれに沿ってやった.

すでに作っておいたpemを使ってログインしようとした.

$ ssh -i "Users/cureseven/.ssh/ec2-ruby.pem" ec2-user@ec2-XX-XXX-XXX-XXX.us-east-2.compute.amazonaws.com

 

Warning: Identity file Users/cureseven/.ssh/ec2-ruby.pem not accessible: No such file or directory.The authenticity of host 'ec2-XX-XXX-XXX-XXX.us-east-2.compute.amazonaws.com (XX-XXX-XXX-XXX)' can't be established.
ECDSA key fingerprint is SHA256:jfJtC0F+1roIltvqNOvlO+xdBOa57B/CwNXuhC99kTg.
Are you sure you want to continue connecting (yes/no)? yesFailed to add the host to the list of known hosts (/Users/cureseven/.ssh/known_hosts).ec2-user@ec2-XX-XXX-XXX-XXX.us-east-2.compute.amazonaws.com: Permission denied (publickey).

 $ chmod 400 ~/.ssh

もやったけどな