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