본문으로 바로가기

ssh 연결 오류

category Linux 2025. 5. 28. 08:32
The authenticity of host '10.138.2.4 (10.138.2.4)' can't be established.
ECDSA key fingerprint is SHA256:w65WBJsC0XSUTkRbCK8qaoQuAEURqrT5cSDcQz32lOA.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.138.2.4' (ECDSA) to the list of known hosts.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0664 for 'ssh-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 "ssh-key.pem": bad permissions
user@10.138.2.4: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

위와 같이 오류 발생 시 현재 리눅스 서버에서 사용하는 pem 키의 권한이 너무 많아서 발생하는 오류이다.

해결 방법은 아래와 같이 소유자만 권한을 주면 해결 가능하다.

[azureuser@web ~]$ chmod 600 ssh-key.pem
[azureuser@web ~]$ ssh -i ssh-key.pem user@10.138.2.4
Activate the web console with: systemctl enable --now cockpit.socket

Register this system with Red Hat Insights: insights-client --register
Create an account or view all your systems at https://red.ht/insights-dashboard
[azureuser@office ~]$ exit​