2017-11-10 2 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