WEBVTT
Kind: captions
Language: en

00:00:01.120 --> 00:00:05.360
OpenSSH will now generate&nbsp;
more secure keys by default.

00:00:05.360 --> 00:00:08.826
Will this break your&nbsp;
workflow? [intro music starts]

00:00:08.826 --> 00:00:11.187
[music stops] Probably not.

00:00:11.243 --> 00:00:17.320
[intro music for real this time,&nbsp;
yes that's a real SID chip]

00:00:17.320 --> 00:00:22.960
Greetings, and welcome to a cryptographic-tastic&nbsp;
episode of Veronica Explains.

00:00:22.960 --> 00:00:27.760
I'm Veronica, and today I'm going&nbsp;
to cover a recent change to OpenSSH,&nbsp;&nbsp;

00:00:27.760 --> 00:00:30.000
and what it could mean for you.

00:00:30.000 --> 00:00:37.880
As of OpenSSH version 9.5, the `ssh-keygen`&nbsp;
program will generate keys using the Ed25519&nbsp;&nbsp;

00:00:37.880 --> 00:00:45.760
algorithm by default, instead of the older,&nbsp;
slower, and often less secure RSA algorithm.

00:00:45.760 --> 00:00:51.680
This updated version of `ssh-keygen` just&nbsp;
rolled out to my Debian Sid installation,&nbsp;&nbsp;

00:00:51.680 --> 00:00:56.440
so it's certainly coming&nbsp;
to a distro near you soon.

00:00:56.440 --> 00:01:00.680
In a bit, I'll talk about the practical&nbsp;
implications of the change. But first,&nbsp;&nbsp;

00:01:00.680 --> 00:01:05.280
what do these encryption algorithms actually mean?

00:01:05.280 --> 00:01:09.960
This gets pretty complex, and&nbsp;
I'm certainly no cryptographer,&nbsp;&nbsp;

00:01:09.960 --> 00:01:14.680
so do your own research and make sure&nbsp;
to treat me well in the comments.

00:01:14.680 --> 00:01:19.320
What I'll say right away is that I've been&nbsp;
using these new keys myself for years,&nbsp;&nbsp;

00:01:19.320 --> 00:01:24.440
and they work fine. So, if you're fine with&nbsp;
defaults and working with modern systems,&nbsp;&nbsp;

00:01:24.440 --> 00:01:29.680
there's a really good chance that&nbsp;
this change won't impact you at all.

00:01:29.680 --> 00:01:34.360
And if you're working with older keys,&nbsp;
don't worry- you probably won't have&nbsp;&nbsp;

00:01:34.360 --> 00:01:39.120
to regenerate your existing keys in&nbsp;
order to keep connecting to servers.

00:01:39.120 --> 00:01:43.320
That said, I want to cover the specifics&nbsp;
of this, because there could be some edge&nbsp;&nbsp;

00:01:43.320 --> 00:01:48.880
cases that impact you, particularly if&nbsp;
you work in administration or devops.

00:01:48.880 --> 00:01:53.240
As I covered in my "OpenSSH&nbsp;
for absolute beginners" video,&nbsp;&nbsp;

00:01:53.240 --> 00:01:57.280
OpenSSH lets you connect to a&nbsp;
remote system in an encrypted way,&nbsp;&nbsp;

00:01:57.280 --> 00:02:03.439
and to increase security, the use&nbsp;
of keyfiles is strongly recommended.

00:02:03.439 --> 00:02:03.480
[yes, that's the Mario 64 painting sound]

00:02:03.480 --> 00:02:12.200
The `ssh-keygen` command creates a pair of files-&nbsp;
a public key, and a private key. The public key is&nbsp;&nbsp;

00:02:12.200 --> 00:02:19.480
then tied to the remote system, using a separate&nbsp;
program called `ssh-copy-id`. An algorithm on the&nbsp;&nbsp;

00:02:19.480 --> 00:02:26.120
remote server can compare a private key against&nbsp;
a public key to see if they're tied together.

00:02:26.120 --> 00:02:30.440
So, as long as you keep the private&nbsp;
key private, it can be used as proof&nbsp;&nbsp;

00:02:30.440 --> 00:02:35.520
of your identity, in a way that's much&nbsp;
harder to crack than simple passwords.

00:02:35.520 --> 00:02:39.800
Again, watch my other video if&nbsp;
you're completely new to this stuff.

00:02:39.800 --> 00:02:44.840
Anyway, the `ssh-keygen` program&nbsp;
uses various mathmatical algorithms&nbsp;&nbsp;

00:02:44.840 --> 00:02:48.800
to generate the pair of files&nbsp;
needed to complete this process.

00:02:48.800 --> 00:02:53.480
The former default that `ssh-keygen` used was RSA,&nbsp;&nbsp;

00:02:53.480 --> 00:02:57.120
which used an older mechanism&nbsp;
and results in larger files.

00:02:57.120 --> 00:03:02.320
Ed25519 on the other hand&nbsp;
is a much newer algorithm,&nbsp;&nbsp;

00:03:02.320 --> 00:03:07.840
which as I understand it uses something&nbsp;
called "Twisted Edwards curves" to more&nbsp;&nbsp;

00:03:07.840 --> 00:03:13.400
quickly generate more secure keys, which&nbsp;
are actually smaller than the old ones.

00:03:13.400 --> 00:03:17.680
You can see that here- on a&nbsp;
Sid box, I'll create a key,&nbsp;&nbsp;

00:03:17.680 --> 00:03:23.920
and as you can see, it creates&nbsp;
that key now as an Ed25519 key.

00:03:23.920 --> 00:03:30.506
Now over here, on my Linux Mint Debian Edition&nbsp;
laptop - which I'll be covering in a future&nbsp;video&nbsp;

00:03:30.506 --> 00:03:31.501
[awkward silence] 

00:03:31.501 --> 00:03:35.440
...when I cat out the RSA key,&nbsp;
you can see it's quite long.&nbsp;&nbsp;

00:03:35.440 --> 00:03:41.080
But when I cat out the Ed25519 key,&nbsp;
you can see that it's much shorter.

00:03:41.080 --> 00:03:45.840
And before you comment- don't worry,&nbsp;
these are not production keys,&nbsp;&nbsp;

00:03:45.840 --> 00:03:51.480
so I can share them knowing they're already&nbsp;
deleted by the time you see the video.

00:03:51.480 --> 00:03:55.800
I'll put the full commands&nbsp;I'm using
in the description as well.

00:03:55.800 --> 00:04:00.400
Anywho, thanks to the work of our&nbsp;
industry's cryptographers, we now&nbsp;&nbsp;

00:04:00.400 --> 00:04:03.920
have more secure keys which are actually smaller&nbsp;&nbsp;

00:04:03.920 --> 00:04:09.960
files and are generated faster than the&nbsp;
old ones. What's not to love about that?

00:04:09.960 --> 00:04:15.920
Luckily for most of us, Ed25519 has been&nbsp;
pretty well supported in most systems&nbsp;&nbsp;

00:04:15.920 --> 00:04:21.600
for a number of years, so chances are,&nbsp;
we'll all be just fine with this news,&nbsp;&nbsp;

00:04:21.600 --> 00:04:27.720
even if some of us have to take a few steps&nbsp;
to make sure our processes are up-to-date.

00:04:27.720 --> 00:04:31.983
"Oh no, am I going to have to do some work,&nbsp;
Veronica?" 

00:04:31.983 --> 00:04:34.825
Probably not. But also, maybe!

00:04:35.600 --> 00:04:39.520
Well, first of all, if you aren't a&nbsp;
system administrator or developer,&nbsp;&nbsp;

00:04:39.520 --> 00:04:44.920
it probably doesn't impact you at all. If&nbsp;
you never remotely connect to a server or&nbsp;&nbsp;

00:04:44.920 --> 00:04:51.466
router resource, this probably has no bearing&nbsp;
whatsoever on your life. Thanks for watching.

00:04:51.466 --> 00:04:53.280
[kid shouting "1, 2, 3, 4!"]

00:04:53.280 --> 00:04:59.000
For everyone else, again, particularly&nbsp;
if you work in devops or administration,&nbsp;&nbsp;

00:04:59.000 --> 00:05:03.200
if you have scripts or playbooks or whatever&nbsp;
you might use in your build systems,&nbsp;&nbsp;

00:05:03.200 --> 00:05:08.160
you may want to have a look at any `ssh-keygen`&nbsp;
commands you're running, and if the remote&nbsp;&nbsp;

00:05:08.160 --> 00:05:13.880
systems or equipment requires RSA, you'll want&nbsp;
to make sure you get specific in your commands.

00:05:13.880 --> 00:05:15.640
Now, you might be thinking:&nbsp;&nbsp;

00:05:15.640 --> 00:05:22.400
"what requires RSA here in the roaring&nbsp;
2K20s?" Well, you'd be surprised.

00:05:22.400 --> 00:05:25.320
As a system administrator until recently,&nbsp;&nbsp;

00:05:25.320 --> 00:05:30.680
there were plenty of older systems which&nbsp;
actually did require RSA keys for connections.

00:05:30.680 --> 00:05:35.400
Network equipment comes to mind- often you'll&nbsp;
walk into a server room and see 10-15 year old&nbsp;&nbsp;

00:05:35.400 --> 00:05:40.240
infrastructure still plugging away, and you're&nbsp;
going to need to know how to connect with that.

00:05:40.240 --> 00:05:45.280
I worked in legacy systems, so there were&nbsp;
plenty of older OS build targets that we had&nbsp;&nbsp;

00:05:45.280 --> 00:05:49.600
to keep instructions for, and looking through&nbsp;
my notes, a few of them didn't play nicely&nbsp;&nbsp;

00:05:49.600 --> 00:05:55.680
with anything besides RSA. Admittedly,&nbsp;
that's a bit of an edge case though.

00:05:55.680 --> 00:06:00.120
Here's an example of an ancient&nbsp;
system for testing- I installed&nbsp;&nbsp;

00:06:00.120 --> 00:06:04.880
Ubuntu 8.04 on my classic HP netbook.

00:06:04.880 --> 00:06:11.760
This install predates Ed25519 keys, which I&nbsp;
can see because when I try to connect to it,&nbsp;&nbsp;

00:06:11.760 --> 00:06:16.600
it tells me it can only handle&nbsp;
older methods like RSA and DSS.

00:06:16.600 --> 00:06:21.160
Now, this alert isn't just about key types,&nbsp;
it's about all methods of ssh connection,&nbsp;&nbsp;

00:06:21.160 --> 00:06:27.000
including password based. But it's a pretty good&nbsp;
sign that this system is going to be trouble.

00:06:27.000 --> 00:06:31.440
And that's really the biggest impact this will&nbsp;
likely have on you as an administrator... if&nbsp;&nbsp;

00:06:31.440 --> 00:06:36.880
you know you need older-style RSA keys to&nbsp;
work with specific hardware or software,&nbsp;&nbsp;

00:06:36.880 --> 00:06:42.720
you may need to update any playbooks or&nbsp;
build instructions that use `ssh-keygen`.

00:06:42.720 --> 00:06:47.160
If your target can't be upgraded&nbsp;
to use Ed25519 keys, you'll want&nbsp;&nbsp;

00:06:47.160 --> 00:06:54.280
to append the appropriate keytype using the&nbsp;
`-t flag`, such as `-t rsa`, adding that to&nbsp;&nbsp;

00:06:54.280 --> 00:07:01.560
your `ssh-keygen` commands. Using that `-t` flag&nbsp;
will generate the type of key that your system needs.

00:07:01.560 --> 00:07:07.640
As always, if you want to learn more, the man&nbsp;
page is going to be your friend- `man ssh`,&nbsp;&nbsp;

00:07:07.640 --> 00:07:13.520
`man ssh-keygen`, and `man sshd`&nbsp;
are going to be helpful here.

00:07:13.520 --> 00:07:18.120
Here's the thing- if you mainly work&nbsp;
with up-to-date systems from the last&nbsp;&nbsp;

00:07:18.120 --> 00:07:21.760
couple of years, you're probably going to be OK.

00:07:21.760 --> 00:07:27.400
And again, like I said at the top, there's&nbsp;
no reason to suspect your existing keys won't&nbsp;&nbsp;

00:07:27.400 --> 00:07:34.400
continue to work just fine. Just be prepared for&nbsp;
more secure keys the next time you generate them.

00:07:34.400 --> 00:07:38.240
Of course, even if you aren't directly impacted,&nbsp;&nbsp;

00:07:38.240 --> 00:07:41.480
this isn't a bad time to go&nbsp;
through your keys and update them.

00:07:41.480 --> 00:07:46.680
I like to go through my key lists in the .ssh&nbsp;
folder periodically and make sure I've pruned&nbsp;&nbsp;

00:07:46.680 --> 00:07:52.240
the old and backed up the current. If you&nbsp;
haven't regenerated your keys recently,&nbsp;&nbsp;

00:07:52.240 --> 00:07:55.280
now might be a good time to beef up your security.

00:07:55.280 --> 00:07:59.320
After all, I never like leaving&nbsp;
old keys around for too long.

00:08:00.160 --> 00:08:05.280
As I showed before, you can quickly tell&nbsp;
what type of key you're creating by default,&nbsp;&nbsp;

00:08:05.280 --> 00:08:09.600
simply by typing `ssh-keygen`&nbsp;
without any parameters.

00:08:09.600 --> 00:08:16.040
If it says "generating public/private&nbsp;
rsa key pair.", note the `rsa` here,&nbsp;&nbsp;

00:08:16.040 --> 00:08:21.320
then you're on an older version. You&nbsp;
can always press Ctrl-C to bomb out,&nbsp;&nbsp;

00:08:21.320 --> 00:08:29.240
and then run it again with the `-t ed25519`&nbsp;
option to generate the more modern pair of keys.

00:08:30.040 --> 00:08:34.160
I personally prefer to maintain&nbsp;
different keys for each server,&nbsp;&nbsp;

00:08:34.160 --> 00:08:40.120
and I keep an extensive config file that points to&nbsp;
the ones that I need. If you want to learn more&nbsp;&nbsp;

00:08:40.120 --> 00:08:46.920
about the config file, my OpenSSH video from&nbsp;
a couple of years ago is still pretty good.

00:08:46.920 --> 00:08:52.440
One of the things I love about the Linux and&nbsp;
open source ecosystem is the fantastic group&nbsp;&nbsp;

00:08:52.440 --> 00:08:57.600
of researchers building more secure&nbsp;
ways for all of us to stay connected.

00:08:57.600 --> 00:09:04.320
But that shouldn't surprise anyone,&nbsp;
because Linux is awesome! And so are you.

00:09:04.320 --> 00:09:08.720
And now for a new segment I'm&nbsp;
calling "What I'm Watching",&nbsp;&nbsp;

00:09:08.720 --> 00:09:11.664
where I shout out another creator's video.

00:09:11.664 --> 00:09:13.240
[child shouting "1, 2, 3, 4!"]
[punk music starts]

00:09:13.240 --> 00:09:16.840
Today, I'd like to shout out&nbsp;
Macintosh Librarian's recent&nbsp;&nbsp;

00:09:16.840 --> 00:09:22.160
exploration of a Power Computing&nbsp;
Macintosh Clone from the 1990s.

00:09:22.160 --> 00:09:26.040
Macintosh Librarian is one of&nbsp;
my favorite channels. She does&nbsp;&nbsp;

00:09:26.040 --> 00:09:30.480
these fun explorations of vintage Apple and&nbsp;
Apple-adjacent equipment and software,&nbsp;&nbsp;

00:09:30.480 --> 00:09:35.000
and I've learned quite a bit about&nbsp;
our shared computing history from her.

00:09:35.000 --> 00:09:42.729
Plus, her pal Maccy is a gem.&nbsp;
Seriously, you've gotta go check out her channel.

00:09:42.729 --> 00:09:48.152
[punk guitar outro, yes I made this]

00:09:48.152 --> 00:09:55.701
 

00:09:55.701 --> 00:09:59.632
"Oh no! Am I going to have to do some work, Veronica?"

