Easy Step-by-Step Process:
ssh into your root directory where you store your keys.
~/.ssh (directory)
check if the two keys are present (private key) (public key)
if not present add them (id_rsa) (id_rsa.pub)
Run this command chmod 400 ~/.ssh/id_rsa
ssh again into your server (ssh ubunt@ip)
Conclusion: Making read-only file(chmod 400 file_name): To make a file read-only means only the owner is able to read it, You have to give read permissions to the owner and no permissions to others and group, so “400” is the octal representation for this.