Introduction to Ansible Transcripts
Chapter: Running Playbooks
Lecture: Create A New SSH Key
0:00 So we want to create an SSH key
0:01 so, when you click "new SSH key"
0:03 what they're looking for is the public key.
0:06 So this was on earlier videos
0:07 every SSH key pair has a public key
0:10 you can share that with whoever
0:11 and you've got your private key
0:12 which you never want to share with anyone
0:14 and your private key is what authenticates you
0:16 instead of a password, or together with a password.
0:19 So switch back over into the command line
0:21 and we'll save this host file for now.
0:23 Reuse the ssh-keygen command, so RSA key
0:29 we want it to be 4096 bits
0:32 and then depending on your operating system version
0:35 it's good to try out "-o" flag. And that's a lowercase "o".
0:40 And some versions of ssh-keygen don't have the "-o"
0:43 the -o indicates that ssh-keygen should save it
0:46 in an OpenSSH format that is more secure.
0:50 There were previous versions of Ubuntu
0:51 and other Linux distributions that were saving SSH keys
0:55 in more insecure formats, so try the "-o".
0:58 If it doesn't work for you, remove that from the command
1:00 and then specify your email address, with "-C".
1:09 We'll save it as "first playbook"
1:11 and we won't use a passphrase.
1:14 Okay, so now we've got first playbook
1:16 and first playbook pub, we want to use "first_playbook.pub"
1:19 copy and paste this over into digital ocean.
1:26 Paste that in
1:27 as long as there's no error message, should be good
1:30 if there is an error message
1:31 that may indicate that you've pasted in your private key
1:33 by accident.
1:38 Click "Add SSH key", and that'll actually be saved
1:42 for future use whenever you create a new droplet.
1:46 All right, scroll down, and if you want to, optionally
1:49 you can change the host name.
1:52 I usually like to change it to something a little simpler
1:56 and go ahead and click "create".
2:00 Now, it might take a few minutes
2:01 but the droplet will be revisioned
2:03 and then we'll be able to click into it
2:04 and get our IP address.
2:11 Go ahead and copy that, if you just click on the IP Address
2:14 it should copy it.
2:16 Back over into our inventory file
2:19 and paste in that IP address.