SCP without a password between two Linux boxes

How to configure passwordless login in Mac OS X and Linux

 

I am working on automating the updates of the Firewall databases.  I created a crontab entry for each of the scripts to copy the parsed data to text files in logs folder under a user.  It is set to run at 1am every morning and parse the previous day’s log. 

The next part of the project was getting scp to work in a script without having to log in.   You start by generating a ssh-keygen -t rsa file for your target computer that will receive the files from the syslog server.   In /etc/hosts, I created a entry for syslog

ssh-keygen -t rsa is used to create the public key you will copy to the syslog computer.

ssh-copy-id -i ~/.ssh/id_rsa.pub username@syslog  this will copy the public key file to the syslog server.     You should be able to ssh user@syslog at this time.   If yes, scp will work in a script without a password needed.   You are using a public key.   I copied the public key into ./ssh as authorized_keys and set it in the sshd.config.   I set .ssh as chmod 700 and authorized_keys as 600 to protect it.