[Troubleshooting] pem 키로 ssh 접근 시 권한 문제가 발생하는 경우
[Troubleshooting] pem 키로 ssh 접근 시 권한 문제가 발생하는 경우
🚫 현상
pem키를 사용하여 ssh 접근 시 다음과 같이 에러가 발생
1 2 3 4 5 6 7 8
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0644 for 'amazonec2.pem' are too open. It is recommended that your private key files are NOT accessible by others. This private key will be ignored. bad permissions: ignore key: amazonec2.pem Permission denied (publickey).
💡원인
🛠 해결책
읽기만 가능하도록 접근 권한을 바꿔줘야 한다.
1 2 3 4 5 6 7
# unix 기반 chmod 400 key.pem # windows icacls.exe key.pem /reset icacls.exe key.pem /grant:r %username%:(R) icacls.exe key.pem /inheritance:r
🤔 회고
📚 Reference
This post is licensed under CC BY 4.0 by the author.