![]() SSH into the remote machine using ssh and execute: Scp ~/rsync-key.pub put the public key into the authorized_keys file on the remote host. ![]() Your public key has been saved in /home/user/rsync-key.pub.Ĩc:57:af:68:cd:b2:7c:aa:6d:d6:ee:0a:5a:a4:29:03 copy the public key to the remote machine using Secure Copy: Your identification has been saved in /home/user/rsync-key. $ ssh-keygen -t dsa -b 2048 -f ~/rsync-keyĮnter passphrase (empty for no passphrase): Įnter same passphrase again: On the local machine, drop into the terminal and enter: To allow your systems to make an SSH connection without asking for a password, you must generate passphraseless keys. The first step in automating remote backups is to remove any required user intervention - namely requests for SSH passwords. Congratulations on your first remote backup! Now let’s automate the process. ![]() Omitting the trailing slash causes rsync to copy both the directory name and its contents to the destination.Īfter rsync completes, you’ll be left with a copy of the source files on the remote computer. Rsync -avz -e ssh /some/small/directory/ trailing slash in the source directory causes rsync to copy only the contents of the source directory. On the remote machine, create a destination directory to hold your backups: Once you know all the necessary programs and permissions are in place, choose a directory with a few small files to use as a test backup. If the remote machine is the destination where the rsync backup will be stored, you’ll want read and write permission to the destination directory. To ensure that sshd is running on a remote machine, enter a terminal session and type ssh If all is well, you should be asked for the user’s password and allowed to log in and check permissions. Make sure your remote machine has Secure Shell Daemon (sshd) running and that the users of both machines have proper permissions to execute a backup. I’m going to assume you’re running Linux or OS X on the remote machine where the backup is to be stored. SSH is likely to already be installed on your Mac OS X and GNU/Linux systems, while the Windows port of rsync, cwRsync, includes the key SSH programs. Mac OS X comes with rsync, but if you want to try a different version, check out RsyncX. If you’re running Microsoft Windows I recommend installing cwRsync. Use your GNU/Linux distribution’s package management system to do this, or download and install the source from the rsync Web site. If you receive “command not found” or a similar message, you’ll need to download and install rsync. You should see a message like rsync version 2.X.X protocol version X. Make sure rsync is installed by opening a terminal session and typing rsync -version on each machine. Rsync can use SSH as a secure transport agent. To perform secure remote backups, you must have rsync and SSH installed on both your local and your target remote machine. Remote backups, where you store your backed up data on a separate machine, further promote data safety by separating information both physically and geographically. In an earlier article, I explained how to use rsync to make local backups of a Linux system. Many Linux users know rsync as a file transfer utility, but rsync can also be an efficient tool for automating remote backups of your Linux, Windows, and even Mac OS X systems. Backups are more important than ever these days, as our digital information collections expand.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |