Search This Blog

Thursday, May 23, 2019

Permissions 0644 for xxxx.pem are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. Permission denied (publickey)


Facing error when try to SSH to my ubuntu server from Mac


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/Users/xxxx/Desktop/Working Folder/xxxx.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 "/Users/xxxx/Desktop/Working Folder/xxxx.pem": bad permissions
ubuntu@xxx.xxx.xxx.xxx: Permission denied (publickey).
Keiths-MBP:~ keith$ ssh -i '/Users/xxxx/Desktop/Working Folder/xxxx.pem' ubuntu@xxx.xxx.xxx.xxx
_________________________________________________________________________________

To solve the problem, change the file 'xxxx.pem' permission to 600.

Open Mac Terminal and enter command line below.

sudo chmod 600  '/Users/xxxx/Desktop/Working Folder/xxxx.pem'

try the SSH again, problem solved.