Andrew Fletcher published: 7 July 2022 1 minute read
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 Fletcher
•
21 Apr 2024
This command will help you spot any unusually large directories
The red flag was when I saw the server disk space is showing a site is taking up 57992.5 MB, where locally the site size is showing 957MB. There is something serious happening here and I need to establish the problem quickly. When dealing with a significant discrepancy in site size...
Andrew Fletcher
•
12 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 Fletcher
•
09 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...