Lost Password? No account yet? Sign up! Why bother?
  • Narrow screen resolution
  • Wide screen resolution
  • Auto width resolution
  • Increase font size
  • Decrease font size
  • Default font size

SmallNetBuilder - Small Network Help

  
Home arrow NAS arrow NAS How To arrow How To Back Up Offsite for Free with rsync
How To Back Up Offsite for Free with rsync Print E-mail
Kevin Herring   
September 25, 2007
Slashdot
Digg
Technorati
Delicious
Stumble

Installing SSH & rsync on the Server

rsync is a brilliant little program that is fairly common in Linux. It is basically used to synchronize two folders or file systems and consists of a daemon/service running on the server machine and a small application running on the client machine.

The great thing about rsync is that it splits the file up into chunks and then copies over only the chunks that have changed. So let's say you changed the artist in the tag of an MP3, it will copy only the chunk that contains the change over. This makes it fast, efficient and very suited to backing up over the Internet.

So the first thing we need to do is install SSH and rsync on your server machine The best version of rsync for Windows is called cwRsync. The server package can be downloaded from SourceForge here. Install it normally and ensure that you check the option to install OpenSSH server.

You will need to do this as an administrator, since it will install two services—one for rsync and the other for OpenSSH. These are not started by default, so go to Start->Run and type in services.msc to bring up the services screen (Figure 1). Locate the services called Openssh SSHD and RsyncServer, start them and set the Startup Type for each one to be Automatic.

Service console showing OpenSSHD and rsync server
Click to enlarge image

Figure 1: Service console showing OpenSSHD and rsync server

Next, we need to activate a user so that we can use it to log in. cwRsync should have installed a menu item in your Start Menu. Locate it and click on 05. Start a UNIX BASH Shell. Which will bring up a command line. Then type in activate-user.sh and you'll see the following response:

$ activate-user.sh
?###############################
Activate a user for copssh
###############################
Do you want to activate a (l)ocal or a (d)omain user [l/d] ?

Enter 'l' for local and the system will respond with a list of local users:

User accounts for \\WIGGUM
-----------------------------------------------------------------------
Administrator            ASPNET                   Guest
HelpAssistant            kevin                    sshd
SUPPORT_388945a0         SvcwRsync

Enter a user account for activation : 

Now enter the user you wish to activate. In my case, I entered "Kevin" and pressed the Enter key. The user activation process will then prompt to enter a passphrase to use with key generation. But since we'll be using our own keys, as you'll see later, just hit the Enter key to let the user activation process finish up:

Generate a 2048-bit RSA key pair for public key authentication:

A passphrase is similar to a password and is used to protect
the private key. Good passphrases are 10-30 characters long,
are not simple sentences or otherwise easily guessable
(English prose has only 1-2 bits of entropy per character, and
provides very bad passphrases), and contain a mix of upper and
lowercase letters, numbers, and non-alphanumeric characters.
NB! There is no way to recover a lost passphrase. If the passphrase
is lost or forgotten, a new key pair must be generated

Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Private key is /home/kevin/.ssh/kevin
/bin/activate-user.sh: line 110: ln: command not found
A shortcut/symbolic link to your windows home directory is created (myh
processed file: C:\Program Files\cwRsyncServer\home\kevin\.ssh\kevin
processed file: C:\Program Files\cwRsyncServer\home\kevin\.ssh\kevin

Activation process for kevin is completed.
You may establish an ssh connection to this machine now.

Press a key to continue ...

kevin@wiggum /
$

Note that the program also creates a 'home' directory for the user in C:\Program Files\cwRsyncServer\home\. This directory will be the same as your user name and will contain a subdirectory called .ssh, which will contain your keys we will generate later. The username should be the one that you normally log into Windows with, that has a strong password. This machine will be accessible to everyone from the Internet unless you set up good security!

Now we need to change the port number that SSH is listening on from 22 to 443. Leaving it on 22 is not generally a good idea because you will be subject to frequent hacking attempts, and 443 can be useful to us as you will find out later.

Browse to the file C:\Program Files\cwRsyncServer\etc\sshd_config. Open it with WordPad and near the top you should see a line that says Port 22. Change this to Port 443. Next, stop and restart the SSH service in the services console.

Now let's test the server. Load up PuTTY (still on the server machine) and connect to localhost, being sure to change the port to 443. You should now be presented with a warning about accepting the key into the cache. Accept this and you will be presented with the login prompt. Enter the name of the user you set up before and then type in your Windows password. If all is well, you will now see a DOS-style command prompt. Since this was just a test, you can close PuTTY for now.



Comments (22)Add Comment

Write comment

busy

Tags: Backup, NAS, rsync,

Related Articles:

How To Securely Web Browse via an SSH Tunnel
A DIY SSL VPN with SSL-Explorer - Part 1
How To: Convert your Xbox to a NAS - Part 2
Vista Networking: Part 1- The Dragon's Trap
How To: Asterisk Answering Machine
 

Top NAS Products

MediaSmart Server EX470
Lowest Price: $ 511.98

ReadyNAS Duo 500GB Network Attached Storage
Lowest Price: $ 352.06

LinkStation Pro Duo 1TB Network Attached Storage
Lowest Price: $ 265.00

EX475 MediaSmart Server
Lowest Price: $ 655.50

SC101 Storage Central
Lowest Price: $ 26.96

Most Read

 
 

Over at the Forums

Gigabit CAT6 Kit for Installing & Testing: Terminiation, Crimping etc.
Gigabit CAT6 Kit for Installing & Testing: Terminiation, Crimping etc. ---Quote--- The cable infrastructure is the most often overlooked and most...

Building a HTPC cloud for home
As a HTPC enthusiast, I have a bunch of PCs, NASes & networking gears in my home. My current project is to upgrade the connection speed between my...

DIR-615 REVB2 with F/W 2.25 and DES-1105 Switch
I have a D-Link DIR-615 REVB2 Wireless Draft 2.0 802.11n router with F/W 2.25 and have enabled the QoS engine on the router and I am planning on...

NAS = High Margin?
It seems NAS are generally using Open Source OS and some cheap components. While the software may not be totally free. It still much cheaper then...

HTPC or Set Top Box
There doesn't seem to be any really good choices, or maybe there's too many, because I can't decide how I want to handle streaming from the Internet...

Slideshows

Thecus N3200 RAID 5 NAS D-Link DIR-628 RangeBooster N Dual Band Router Adtran NetVanta 3120 Buffalo LinkStation Mini Intel Entry Storage System SS4200-E D-Link DAP-1522 Xtreme N Duo Wireless Bridge / Access Point More

Win This!

You could win this D-Link Xtreme N Duo Wireless Bridge / Access Point

Learn How!

 
Go Shopping with PriceGrabber

Get Email Updates

Enter your email address:

Delivered by FeedBurner once a day

 


This page took 0.225228071213 seconds to load.