맥북 Terminal을 이용해서 원격서버 (리눅스)에 접속을 시키기 위한 방법으로 

맥 terminal에서 

ssh 사용자이름@원격서버ip주소 

 

을 입력하여 접속을 시도하면

 

아무것도 일어나지 않는다. 몇초~1분 사이에

 

ssh: connect to host server_address port 22: Operation timed out

라는 에러만 나온다.

 

지금 생각해보면 내 맥북의 문제는 네트워크상 문제가 제일 큰 것 같다.

 

Apple에 관한 Q&A가 전문적으로 이루어지는 apple.stackexchange.com에서

에러에 관한 댓글 중 가장 많은 따봉을 받은 댓글을 가져와봤다. 

 

Please check that you are connecting to your targeted server with the right network interface. If you are using the infamous Automatic location you might be networking the wrong way (for example through the neighbour free wi-Fi when you thought you were using your company VPN)

 

정확한 네트워크 인터페이스로 원격서버(리눅스)에 연결하라는 뜻이다.(from MacOS to LinuxOS)

그렇지 않으면 잘못될 거다~. 

대충 스타벅스에서 제공하는 공공 wi-fi 를 이용하여 네트워크를 설정하면 안된다는 뜻 같다.

 

.

.

.

.

 

 

 

3 commands may help you to track down this protocol failure:

ping server_address
traceroute server_address
ssh -v login_name@server_address

 

위 명령어 중 1개를 사용하면 네트워크의 설정이 잘못된 것인지 확인할 수 있다.

 

보통 ping을 많이 사용한다.

 

네트워크 설정을 올바르게 했다면! 이렇게 확인한다.

nmp -Pn -p22 server-address

 

 

ssh 접속 실패시

IP 이외에도 방화벽, config 파일 설정, service 파일 설정, host.* 파일 등의 문제가 있는데, 

집에 가면 맥북으로 다시 해봐야겠다...


 

How to keep SSH Connections Alive on Mac

 

연결 끊기는 에러 잡기// 

 

vi~/.ssh/config 

 

Add lines : 

 

Host * ServerAliveInterval 60 

 

 

Save and Exit 

 

Just Tweak some permissions and you'll be good to go.

 

 

chmod 600 ~/.ssh/config 

 


 

 

+ Recent posts