hotamul의 개발 이야기

[AWS] Unprotected private key file 본문

etc.

[AWS] Unprotected private key file

hotamul 2023. 3. 8. 23:07
...
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for 'demo-server-key.cer' are too open.
It is required that your private key files are NOT accessible by others.
...

위와 같이 UNPROTECTED PRIVATE KEY FILE에러는 key 파일의 실행 권한이 너무 열려있다는 뜻이다.

chmod 400으로 나에게만 Read 권한을 주어 해결할 수 있다.

$ chmod 400 ~/.ssh/demo-server-key.cer

chmod의 숫자는 read(4), write(2), execute(1) 합의 조합으로 권한을 표시하는 것이고 권한400의 의미는 나/그룹/전체에 대한 권한 중 나에게만 읽기 권한을 준다는 의미 이다. (5면, 5 = 4 + 1 로 read, write 권한)

Comments