Like every other website on the planet, SmallNetBuilder uses cookies. Our cookies track login status, but we only allow admins to log in anyway, so those don't apply to you. Any other cookies you pick up during your visit come from advertisers, which we don't control.
If you continue to use the site, you agree to tolerate our use of cookies. Thank you!

Router Charts

Click for Router Charts

Router Ranker

Click for Router Ranker

NAS Charts

Click for NAS Charts

NAS Ranker

Click for NAS Ranker

More Tools

Click for More Tools

NAS How To

Adding Public / Private Key Authentication

Now we are going to change the server login process so that it can be run automatically for use in scripts and scheduled tasks.

Download PuTTYgen, which we will use to generate our keys. Load it up, click on Generate and then wiggle the cursor over the blank area until the progress bar finishes. This will generate two keys (Figure 2). The Public one is put onto the server and it doesn't really matter who sees it. The Private one should be kept secure because whoever has the Private key can use it to log into your server without using a password!

Using PuTTYgen to generate Public and Private keys

Figure 2: Using PuTTYgen to generate Public and Private keys

Add a comment to the key if you wish, and then click Save private key. Answer Yes to saving the key without a passphrase and save it somewhere safe with a meaningful name. Also, as I first didn't realize and took a good deal of hair-pulling to find out, PuTTY and OpenSSH have different format private keys. Since we will be using the OpenSSH client with rsync, click Conversions-> Export OpenSSH Key and save that too. Don't worry about saving the Public key in a different format.

Now in the .ssh directory that was created above (in C:\Program Files\cwRsyncServer\home\kevin), there should be a file called authorized_keys. Open this in WordPad and paste the contents of the big text-box at the top of PuTTYgen into the file. It should paste onto a single line. Save and close the file, and close PuTTYgen.

Now in PuTTY, we will now try to connect using the key instead of the password. Enter localhost and 443 as before, but now add two more options. Click Connection and change the Auto-login username to be the one you created previously. (Figure 3)

Entering the Auto-login username in PuTTY

Figure 3: Entering the Auto-login username in PuTTY

Then expand the SSH branch and click Auth. In the Private key file for authentication enter the location of the file you saved in the previous step (Figure 4).

Entering the Private key file location in PuTTY

Figure 4: Entering the Private key file location in PuTTY

Now when you click Connect, PuTTY should connect without asking for a username or password. Neat eh? As you now see, anyone with your private key can log into the server, so keep it very safe.

We now have a automatic secure connection to a remote server. Now, it's time to do something with that connection!

More NAS

Wi-Fi System Tools
Check out our Wi-Fi System Charts, Ranker and Finder!

Support Us!

If you like what we do and want to thank us, just buy something on Amazon. We'll get a small commission on anything you buy. Thanks!

Over In The Forums

Hi There,Update 2020/09/11 386 rc2-5 (9.0.0.4_386_40018)https://drive.google.com/drive/folders/1Sqzva4uK7DTrp7oV93__LR6FZoDOckrN?usp=sharingChange lo...
Hi, currently running Merlin on a AX3000 and a AC68U as a mesh node. I really need extra ethernet ports and recently discovered the RT-AC88U had 8!Any...
I am now on my third replacement AC5300 router and about to give up on ASUS completely. I used to have a Netgear Nighthawk AC2300 with a matching exte...
Greetings fellas- I have read all the threads with the 86u hardware issue with the wireless channel and wanted some feedback and help from you guys if...
VyprVPN provides an App that can be only used with Tomato Shibby; it seems that Shibby is out of date (last update 2017). For router configurations, I...

Don't Miss These

  • 1
  • 2
  • 3