2017-11-10 13 views
2

AWSにSSL証明書をインストールする際に、私は古いCRTファイルの名前を変更しましたが、今はSSH経由でAWSインスタンスにアクセスできなくなりましたファイル名を修正します。SSL crtファイルを移動した後、SSH経由でAWSにアクセスできなくなりました

SSH以外のAWSインスタンスのファイルにアクセスする方法はありますか?または、SSL証明書がダウンしているときにSSHを使用してインスタンスにアクセスする方法はありますか?

もともと私は、ファイル名の変更後に接続されたとき、私は、サーバーからこのプロンプトの応答を得たときにSSH:私は、サーバー上で再起動を行なったし、今、私は

> ssh -vv -i tc.pem [email protected] 
OpenSSH_7.5p1, OpenSSL 1.0.2l 25 May 2017 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug2: resolving "tc.com" port 22 
debug2: ssh_connect_direct: needpriv 0 
debug1: Connecting to tc.com [1.1.1.1] port 22. 
debug1: Connection established. 
debug1: key_load_public: No such file or directory 
debug1: identity file tc.pem type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file tc.pem-cert type -1 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_7.5 
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH_6.6.1* compat 0x04000000 
debug2: fd 3 setting O_NONBLOCK 
debug1: Authenticating to tc.com:22 as 'ubuntu' 
debug1: SSH2_MSG_KEXINIT sent 
Connection closed by 1.1.1.1 port 22 

ある時点で私は、サーバーに取得したり、名前を変更するにはどのような方法でファイルにアクセスすることができれば、それは簡単に修正だろう

> ssh -i tc.pem [email protected] 
ssh: connect to host tc.com port 22: Connection timed out 

:私はSSHにしようとすると、これを取得します。誰もが提供できるあらゆる助けを感謝します。

答えて

1

これはかなり簡単です。基本的には、EC2インスタンスのルートボリューム(EBSボリューム)を別のインスタンスにマウントし、.ssh/authorized_keysを編集して、そのボリュームをインスタンスに再接続します。ここで

は、このステップバイステップをカバー記事です:

SSH Key Access Recovery on EC2 Instances

インターネット上で同様の記事がいくつかあります。

+0

これは完全に機能しました。私は[この他のページ](https://aws.amazon.com/articles/how-to-recover-an-unreachable-linux-instance/)の中にあって、その情報とほぼ同じ情報を持っていましたあなたは提供しました。私はext4だから少し違ってマウントする必要がありましたが、それもここでカバーしています(https://stackoverflow.com/questions/28792272/attaching-and-mounting-existing-ebs-volume-to-ec2 -instance-filesystem-issue)を実行します。助けてくれてありがとう、ジョン! – Rob

関連する問題