Ubuntu 16.04 How to install rsync server for other systems to access via ssh using cron
Mia Lopez
Setup: system "prime" with Ubuntu 16.04 and a second hard drive just for backups.
/dev/sdb1 is mounted at /mnt
I created a subdirectory named /mnt/prime for the first backup, of the prime boot SSD contents.
--> Running the command:
sudo rsync -aAXv / --delete --ignore-errors --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} /mnt/primedoes indeed make a nice mirror copy of the root file system into that directory /mnt/prime
So now, in attempting to set up a rsync server for the rest of the Linux systems (Another Ubuntu and a handful of Raspian Jessie systems), I am following these directions:
How to Use rsync to Backup Your Data on Linux
EXCERPT: it says to enter the following two commands:
yum -y install ssh rsync
sudo apt-get install ssh rsyncFirst problem is that there is no yum command on this system, so I skipped that step. rsync installed with no problems.
All of my systems have done the passwordless login setup
ssh-keygen
ssh-copy-id ~/.ssh/id_rsa.pub primeand I have no problem with passwordless scp copies.
The question is: how to I proceed so this system can become a rsync server for other Linux systems.
42 Answers
You're using the wrong tool for the job. In the Debian world (which includes Ubuntu), packages are installed using apt or apt-get. This is the system's package manager. You were trying to use a package manager (yum) from a different family of distributions, the Red Hat family. This is actually mentioned in the site you linked to:
On Red Hat distributions, the command is “yum install rsync” and on Debian it is “sudo apt-get install rsync.”
So, instead of this:
sudo yum -y install ssh rsyncDo this:
sudo apt install ssh rsyncAnd forget about yum.
If "prime" prompts for a password even after the public key has been installed, then you need to review /etc/ssh/sshd_config and ~/.ssh on "prime".
/etc/ssh/sshd_config:
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys~/.ssh: (check permissions and naming)
drwx------ 2 [user] [group] 1024 Dec 5 2012 .ssh
-rw------- 1 [user] [group] 5622 May 18 2015 .ssh/authorized_keysAlso check /etc/ssh/ssh_config on "solar" to ensure it references the private key you generated.
3