Demo 12: SSH Keys for Repository Authentication
Take this beginner-level course on 'Atlassian BitBucket' to delve into the core principles and applied benefits for your software projects. This course, made up of 8 lectures and 14 demos, will expertly teach and explain how to perform Git-related tasks along with implementing and connecting BitBucket to third parties while always being aware of the various security options available.
This course would appeal to a range of job roles including software developers, build and release engineers and DevOps practitioners. All of the skills that you will gain from doing this course will yield a tangible dividend for the projects with your enterprise; allowing you to use, control and manage BitBucket to manage and maintain your software products.
- Understand the basic principles of version control as implemented using the Git protocol and
- Learn how to effectively use BitBucket to manage and maintain your software projects
- Assess the benefits of using BitBucket to manage and secure your software engineering assets
- Recognize and explain how to perform all basic Git related tasks such as creating and cloning a repository, branching, and merging.
- Study to implement and connect BitBucket with other 3rd party systems
- Be aware of the different security options available to secure your BitBucket setup
- Be able to use, control, and manage BitBucket through either using the web-based administration console and/or by using a git client.
- Software Developers
- Software Build and Release Engineers
- DevOps Practitioners
To be able to get the most out of this course we recommend having a basic understanding of:
- Software development and the software development life cycle
- Software development tools
- Version control and associated workflows
Related Training Content
After completing this course we recommend taking the 'Introduction to Continuous Integration' Course
To discover more content like this, you will find all of our training in the Cloud Academy Content Training Library.
Okay, welcome back. In this demonstration, we're going to show you how to use SSH keys to authenticate against your repositories. So let's go to clone first and we'll ensure that we've selected SSH and we'll copy the clone URL. We'll jump over into our terminal and we'll create a new directory called testsshaccess. We'll navigate into it. And from here, we'll try and clone our cademo3 repository. Now this should failed 'cause we haven't set our SSH key pair up yet. First thing we'll do then is we'll generate an SSH key pair using ssh-keygen. And the key pair will be named cademo3-key. We won't use a passphrase. So the generation of the public and private RSA key pair has completed successfully. The next thing we'll do is we'll edit into our local SSH agent. If we list the identities that are already added, we can see that it's empty. So, we'll need to add the private key. So, that identity has been added. Over into Bitbucket under our CaDemo3 repository we click Settings. We'LL then go to Access keys and we'll add a key. Now, there's this nice feature here where we can copy this command and we run it locally but we need to access the right public key. What this is going to do is going to pop it out to pbcopy which will put it into our clipboard. So we run that. That's done.
Then we jump into Bitbucket and we can do a paste. So you can see here, this is the output of the public key portion. We'll go to Label, cademo3-key, and we'll add it. So one final thing we need to do. We need to update our SSH 9 hosts file. And we need to add bitbucket.org as a host. If we run SSH-keyscan-t rsa bitbucket.org, we need to take this string here and then we need to add it to our ssh/known_hosts file. So I'm pasting it here. That's completed. All I did there was to paste in that string into the known hosts file. So, if we now kept that out, we're basically saying that yes, bitbucket.org is a known host and we don't mind connecting to it. With everything in place, we can now rerun the git clone command. So again, we're using the bit protocol to clone this directory and therefore it's going to use SSH to authenticate. If all goes well, we should get our assets from this repository, as we are. So we'll let this run for a bit, and then we'll do a directory listing. Excellent. So, our SSH authentication using our key pair has succeeded. If we do a directory listing, we navigate into cademo3. You can see that we've got this repository local. That's been accomplished using SSH authentication. That completes this demonstration. Go ahead and close it and we'll see you in the next one.
Jeremy is a Content Lead Architect and DevOps SME here at Cloud Academy where he specializes in developing DevOps technical training documentation.
He has a strong background in software engineering, and has been coding with various languages, frameworks, and systems for the past 25+ years. In recent times, Jeremy has been focused on DevOps, Cloud (AWS, GCP, Azure), Security, Kubernetes, and Machine Learning.
Jeremy holds professional certifications for AWS, GCP, and Kubernetes (CKA, CKAD, CKS).