본문 바로가기

Back-End

[AWS EC2] PuTTy Network error: Connection timed out

 

우선 제 에러의 원인은 명확한데 잠시 자리를 이동하면서 연결 wifi 상태가 바뀌었기 때문입니다.

이 에러가 뜰 경우 restart session 도 먹히지 않고 해서 해결 방법을 찾아봤습니다.

 

 

 

우선 PuTTy에 연결한 인스턴스 인바운드 규칙을 확인해봅니다.

 

 

SSH 프로토콜에 문제가 있다는 것을 알 수 있네요.

전에 인스턴스는 내 로컬 컴퓨터에서만 연결할 수 있도록 SSH 22번 포트 개방을 내 IP 접속일 때만 허용했습니다.

 

더보기

*SSH란? 

컴퓨터와 컴퓨터가 인터넷과 같은 Public Network를 통해 서로 통신을 할 때 보안적으로 안전하게

통신을 하기 위해 사용하는 프로토콜

 

 

제 로컬 컴퓨터(노트북)의 IP 주소는 연결된 공유기에서 할당을 해주는 유동 IP였습니다.

공유기가 바뀌었으니 "내 IP" 주소가 바뀌는 건 당연하겠죠.

따라서 전에 있던 SSH 인바운드 규칙을 삭제하고 새로 만들도록 합니다.

 

 

 

 

규칙 저장 후, 다시 PuTTy를 재연결해봅니다.

이름표시줄(PuTTy 써있는 맨위 흰색 부분)에서 마우스 오른쪽 클릭 -> restart session 클릭하시면 됩니다.

 

 

 

에러가 안나고 login as: 가 떴습니다! 저는 인스턴스 os가 ubuntu 20.04 이므로 ubuntu를 입력해줍니다~

 

 

 

 

-성공-

 


참고 자료

 

www.quora.com/Why-does-Putty-give-the-error-network-error-connection-timed-out-when-using-it-over-WiFi

 

Why does Putty give the error "network error: connection timed out" when using it over WiFi?

Answer (1 of 2): This is due to IP of ur WIFI changes frequently,U need to go to Security option at Ur console and edit “inbound SSH” [Source] to “MY IP” If u want secure it or change everywhere to access from any network.

www.quora.com

docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html

 

Connection tracking - Amazon Elastic Compute Cloud

Connection tracking Your security groups use connection tracking to track information about traffic to and from the instance. Rules are applied based on the connection state of the traffic to determine if the traffic is allowed or denied. This approach all

docs.aws.amazon.com