Why AWS recommends chmod 400 for a PEM key
The .pem file downloaded when you create an EC2 key pair is the private half of that key. Anyone who can read it can try to authenticate as you, so OpenSSH refuses to use the file while group members or other local users have access.
Mode 400 means the owner can read the key, but nobody can write to or execute it. That matches the AWS guidance for an EC2 key you download once and should not modify.
chmod 400 vs 600 for a PEM file
400Owner can read only. Use this for an AWS-downloaded PEM key.
600Owner can read and write. OpenSSH accepts it, but the extra write permission is usually unnecessary for an EC2 key.
Both modes block group and other users. If you need a broader explanation of owner-only SSH keys, see the SSH key permissions guide or inspect chmod 600 bit by bit.