SSH Tutorial: Nice and Easy [Video]
Want a fun and engaging intro to SSH, SCP, and friends? Look no further than this video tutorial for a practical crash course on SSH.
Join the DZone community and get the full member experience.
Join For FreeEver looked for a practical crash course on SSH that is fun and entertaining at the same time? Then have a look at this brand-new episode of "Marco Codes: SSH Tutorial - Nice & Easy." In this video, you'll learn how to use:
- SSH on the command line, which includes creating keypairs with various algorithms
- SCP to copy/download files
- SSH-agents to improve keyfile handling
- SSH config files to properly manage your SSH target hosts
- SSH keys to checkout repositories from GitHub
You will also explore advanced topics like SSH agent forwarding, SSH tunneling, and using password managers for maximum comfort.
By the end of the tutorial, there won't be many questions left when it comes to using SSH and friends.
What’s in the Video?
Even if you've been using SSH for a while, it makes sense to get a quick overview of how SSH and especially keyfiles work on a conceptual level. Therefore, we're going to start the video with a little hand-drawn diagram of how SSH is supposed to work.
Usually, you use SSH to connect from your local machine to servers. A popular point of contact is Amazon AWS to manage, for example, your EC2 hosts. That's why we'll start creating SSH keys through AWS UI, finding out what the differences are between the different encryption algorithms as well as what different formats (.pem and .ppk) are available.
After having established your first successful SSH connection, we'll repeat the key creation exercise with SSH command-line tools like ssh-keygen, which are available on all major operating systems (Windows, Linux, MacOS).
When you create your public/private keypairs through the command line, you'll have to copy your public keyfile onto the server, which we'll cover in the following authorized_keys
file section.
Somewhat complementary to just opening up new SSH connections is the SCP tool. It lets you upload/download files and folders to/from servers via an SSH connection. We'll quickly cover how to use SCP.
Using SSH with password-encrypted keyfiles makes the most sense, as soon as you are using an SSH agent. SSH agents are again available on all major operating systems, though you'll have to jump through a couple of additional hoops on Windows to get everything up and running as expected. We'll cover all of the needed steps in the video.
Once you have SSH agents up, you can also play with SSH client config files to manage your SSH target hosts, give them nicknames, and even for more advanced scenarios like managing multiple SSH keys across multiple GitHub accounts with the help of aliases! This is a super helpful topic for anyone who's ever had to manage personal and work account SSH keys.
A video about SSH wouldn't be complete if it didn't cover advanced topics like SSH agent forwarding, as well as SSH tunnels. Agent forwarding allows remote computers to use your local keys without ever seeing them, whereas SSH tunnels allow you to connect to firewalled servers, for example, that are only available through the use of a jump host.
Finally, if you want to squeeze some comfort out of SSH, you'll need to use it in combination with password managers, like 1Password or Keypass. They'll let you manage your SSH keys and even provide their own SSH agents, which is so useful that we're going to finish off the video with this.
Check it out and let us know what you think!
Opinions expressed by DZone contributors are their own.
Comments