Skip to main content

Accessing a remote server using PEM key, and I had the following response

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/Users/andrewfletcher/Sites/PEM/{project}.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/andrewfletcher/Sites/PEM/{project}.pem": bad permissions
{username}@{domain}: Permission denied (publickey).

The issue with the permission is that it is set 0644.  I need to alter to 0600, which can be achieved using chmod.

chmod 0600 {key_name}.pem

Test logging in again, now without issue.

Related articles

Andrew Fletcher12 Mar 2024
How to determine the size of a directory in Terminal
To determine the size of a directory using the terminal, you can use the du (disk usage) command. The syntax for this command can vary slightly depending on the operating system you are using, but a common way to use it is as follows: For Linux and macOSdu -sh /path/to/directoryduDisk...
Andrew Fletcher09 Oct 2023
npm package management
A summary of Node package commandsShort cut commandsnpm install <package>npm i <package>npm install --save <package>npm i -S <package>npm install --save-dev <package>npm i -D <package>npm install --global <package>npm i -G <package>npm testnpm...