From the course: Linux Hardening

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Creating and implementing a key pair for login (demo)

Creating and implementing a key pair for login (demo) - Linux Tutorial

From the course: Linux Hardening

Creating and implementing a key pair for login (demo)

This demo is showing you how to create and implement key pairs for SSH login. I'm creating an RSA key. And I'm using the passphrase. That's going to ask me where I want to save the keys. Now I need to copy the public key into the authorized file, which will be looked at by SSH when I try to log in with the key. Except it helps to be in the right directory. So I'm going to switch to my SSH directory. Now that's a hidden directory. That's what the little dot means if you're unfamiliar with that. I'll just run that command again. Now, what I need to do is take my private key and actually copy it over to the machine I'm connecting from. Now, it's simply a matter of just copying the text. Now I need a text editor. Paste in the contents. Now, the one thing I do here is I'll actually change this to an LF for the, not carriage return line feed, but just the line feed, which is the Linux formatting. I do that out of habit, it may not actually be necessary. I'm going to save it, the file now…

Contents