Configuring SSH for automated rsync

In order to rsync files between two servers in an automated sense, you need to setup an appropiate SSH key between both the source and destination servers.

Destination Server

$ cd
$ mkdir .ssh
$ chmod 700 .ssh

Source Server

$ cd
$ mkdir .ssh
$ chmod 700 .ssh
$ ssh-keygen -t rsa
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/userch/.ssh/id_rsa.pub.
$ scp id_rsa.pub user@destination.server :.ssh

Destination Server

$ cd .ssh
$ cat id_rsa.pub » authorized_keys
$ chmod 600 authorized_keys

Source Server
$ ssh user@destination.server

Should it not work, and you are prompted with password the ‘-v’ option may provide some more information to diagnose the problem.

Tagged with: Linux

Related Posts

Why Being Proactive Is Always a Winning Approach

Many companies manage production infrastructure using a reactive model rather than a proactive one. Organizations typically react to warnings and alerts, then implement corrective actions in response. While some companies have well-designed architectural patterns—such as feature flags and rate limiting—that can quickly mitigate the impact of issues, these are merely temporary solutions, not resolutions.

Read more

AWS CLI support for Aurora DSQL and S3 Tables

If you were following the AWS Re:invent keynote yesterday there were several data specific announcements including Aurora DSQL and S3 Tables . Wanting to check them out, I downloaded the latest AWS CLI 2.

Read more

Migrating off of WordPress - A Simplified Stack

The ongoing drama between Wordpress v WP Engine continues to cross my reading list, but I have permanently removed WordPress from my website. I have finally transitioned away from the complex Linux/Apache/MySQL/PHP (LAMP) stack required for self-hosting WordPress on my professional website.

Read more