재학습/오류

[AWS] Permissions for ~ are too open. pem bad permissions 오류 해결

재삉 2024. 5. 13. 08:00
반응형

 

배경

AWS Lightsail에 접근해야하는 소요가있어 아래의 커맨드로 접근을 시도했다.

ssh -i key.pem host_name@host_ip

그런데 뭔가 익숙한 오류가 발생했는데..

 

 

오류내용 

Permissions 0644 for './key.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "./key.pem": bad permissions 
{host_name}@{host_ip}: Permission denied (publickey).

 

오류내용 분석

다른사람들이 접근못해야하는데, 니 pem파일은 권한이 너무 열려있어. 

 

오류조치

파일 주인만 컨트롤 할 수 있게하고 나머지는 접근 못하게 만들면된다.

즉, 

.pem파일에 권한을 600으로 주면 가볍게 해결된다.

chmod 600 ./key.pem

 

반응형