Public Key Authentication with OpenSSH is preferred, as it’s a much stronger method of authenticating to your servers when compared to using password authentication. In fact, password authentication in OpenSSH should always be disabled. But before you can password authentication, you’ll need to set up public key authentication, and that’s exactly what we’ll do in today’s video.

# LearnLinuxTV Sites
? Main site:

? LearnLinuxTV Community:

? LearnLinuxTV Wiki:

# Support LearnLinuxTV (commission earned)
? Check out my latest book, Mastering Ubuntu Server 3rd Edition. Covers Ubuntu 20.04!

? Support me on Patreon and get early access to new content!

☁️ Support LearnLinuxTV and get your own cloud server with Linode:

? Affiliate store for Linux compatible hardware/accessories:

? Check out the Tiny Pilot KVM for your Homelab:

? Check out to spin up your very own Linux or Windows desktop in the cloud:

# Timecodes:
00:00 – Intro
02:32 – Checking if the OpenSSH client is present (Linux)
03:10 – Checking if the OpenSSH client is installed (MacOS)
03:44 – Installing PuTTY (Windows 10)
05:12 – Generating an SSH keypair (Linux and macOS)
08:40 – Testing OpenSSH connectivity (Linux and macOS)
09:30 – Copy the public key over to a remote server (Linux and macOS)
12:09 – Setting up a session for a server in PuTTY for Windows
13:38 – Creating an SSH key pair in Windows with PuTTYgen
15:40 – Using a PEM key to connect to a Linux server via PuTTY in Windows 10

# Video-specific links
? Download PuTTY:

# About Me
? Follow me on Twitter!

? More about me:

# Recommended evergreen videos:
? How to create a bootable flash drive for installing Linux

? Understanding Linux permissions

? OpenSSH Guide

? LVM Deep-dive:

? How to better secure OpenSSH:

☁️ How to create a cloud Linux server with Linode:

? Which distro do I use?

? My recording gear (commissions earned):

#SSH #OpenSSH #Linux

By admin

19 thoughts on “Linux Essentials – Public Key Authentication”
  1. I am very inspired by how much you give back to the linux community. so today I started my own linux blog in my language. not sure how long I will last but I made the first step.

  2. Hey Jay! Quick side note. Windows 10 does come with OpenSSH by default now. I forget which update brought it in, but Microsoft ported OpenSSH to Windows. The client is there by default, and you can install the server portion really easily. Just fire up a cmd or Powershell prompt, and ssh wherever you'd like to go. The ssh agent doesn't seem to be working yet, they have that disabled by default. And Windows won't use Pagent, so using keys properly can be quite the nuisance. But, then again, working in Windows in general is just a nuisance. 😀

    This opens up the ability to manage your Windows servers using Ansible and SSH, rather than Ansible and…shudder…WinRM.

  3. Hi jay, I’ve implemented keys to connect to my servers in my lab, but I also make changes to the ssh config file to disable the pw prompt if someone tries to log in. Is that still necessary following this method?

  4. I have a question about setting up PKA. If you do this, and disable password authentication, then what happens if your laptop blows up or gets stolen? Wouldn't you be locked out of your server forever? If you can only access your server through PKA, and you lose your computer that has the private key on it, then what happens?

  5. @7:04 — Setting a passphrase

    What would you need to do, if you did set a passphrase, but sometime later, you want to change your passphrase?
    Would you need to generate a new key pair, and upload the your new public key, to every server that has your old passphrase?

Leave a Reply

Your email address will not be published.