Using RSA keys in pfsense as root to connect to another host without passwords generates invalid format.

In trying to allow root to log in to another host using rsa keys I received various errors most of which were related to permissions. However, I had created a config file in /root/.ssh.pub.

In this file was a second at the top for all hosts and one of those was the IdentityFile where it pointed to /root/.ssh/id_rsa.

When having another section for the host that states the IP address and username with nothing else pfsense generates a message saying invalid format. If I changed the permissions to the files I got different messages. All folders had the proper ownership.

When I removed the line that pointed to the IdentityFile the ssh worked. I think it was because it is looking for the id_rsa file instead of the id_rsa.pub file.

This is my mistake and it was caused because the .pub is not to be used in this way and it indeed is an invalid file format as the private key is different than the public key contents.