Table of Contents
Last Updated on 2023-07-02 by Kassandra
SSH is a well known tool leveraged in tech. But if you’re new to it, sometimes it can be confusing.
So in this post, I’m going to share with you a few cool tips & tricks to optimize using your SSH connection.
Please note that some links in this post may be affiliate links. If you click on them and then decide to purchase the product or service, I might receive compensation. (Thank you!)
Among many of the hats I wear, being a software developer has been one of my favorites. Not only is the tech field constantly evolving, you have a plethora of opportunities to grow in your own knowledge.
How Did We Get Here?
I was hired back to Cisco in June 2023 for my third round at this incredible company.
It was in a role where I was expecting to leverage all of my talents and prior experience. Including but not limited to my time as a software engineer, community manager, and digital marketer!
Now, I don’t know about you … But I am the kind of person to try and make things easier on myself.
So once everything was confirmed for my new job? I reached out to my manager to see what skills I should refamiliarize myself with or learn.
Of the items listed, I had only heard about Ansible – Red Hat’s automation platform.
My opportunity for growth here was that I had not learned Linux! In my development work, it was rare I needed to be on a Linux machine. And when I did, my interaction was limited or a consistent procedure.
So I decided to take this Linux Bootcamp, since it allows me to gain the knowledge of a Linux administrator. (And the additional benefit of using Ansible in a project!)
Along the way, I ran into a few snags – mostly because I was on Windows using VirtualBox to run my bootcamp Linux system setup. (The trainer was using 2 different Linux distributions for examples.)
So in this post, I am going to be sharing different lessons learned for Linux – explicitly in regards to SSH.
I will be updating this post from time to time, so if you want updates?
Be sure to bookmark this page & join my mailing list.
Background Info On SSH
The SSH meaning (or definition) is a secure shell protocol. It is a cryptographic network protocol for operating secure network services over an unsecured network.
This is a widely used tool on Linux systems and is essential for transferring files & remote administration.
I am generally a Windows user. My current system is Windows 10, so I created an Ubuntu virtual machine installation via VirtualBox.
Once you are able to log into your VM, then you can begin working on connecting your SSH setup.
At the time, my base install was not setup to allow for SSH connectivity.
I will go more into detail soon, but for now I will show you how to ensure you can SSH to your Linux virtual machine from Windows.
Ensure Connection From Windows to Linux Virtual Machine
Below is the recording I made about this as well as additional resources for you.
These same steps are found in this markdown cheatsheet I shared on GitHub.
- Ensure your Linux VM has SSH set up then shut it down. You will need the net-tools package installed.
- Go to the settings for your VM and ensure it has the Bridged Adapter as it’s first network adapter. (should be there, as this is your internet)
- In your VM settings, add your Host-only Adapter as your second network adapter.
- Turn on your Linux VM.
- Find the IP address for the second adapter in your VM. This is the IP address you will use to SSH from Windows.
- Confirm your default gateway is on & configured. If it’s not, you will not be able to connect outside or allow connections.
- Confirm your network connectivity by trying to ping any IP address from your VM.
- From your Windows machine, try to ping the IP address you found in step 5. If you are unable to ping it, you will need to troubleshoot the issue.
SSH Connection to Linux from Windows
There are several options – here are the ones I’ve used when working with VirtualBox on my Windows 10 machine.
Putty SSH Windows to Linux
Putty is one of several SSH tools available. It’s super easy, and as long as you put in the proper IP address and port, you’re good to go. (Naturally your Linux must have SSH configured!)
SSH From WSL To VirtualBox
If you’ve never heard of nor used WSL (Windows Subsystem for Linux) then you should definitely check this out.
Want to use WSL? Open your ubuntu terminal and try to SSH to your VM‘s enp0s8 IP address.
What To Expect On First SSH Connection
Upon first connecting to a machine via SSH, you may see an image like this for Putty:
… or this for WSL:
This is part of the cryptography to help create a secure connection over an unsecured network.
Once you accept, if all of your other settings are correct and you log in with an account with access, your connection should be ready!
As I create more content around SSH connections, I will be updating this post.
So be sure to bookmark it, join my mailing list, or follow me on one of the platforms below.
Thanks and have a prosperous rest of your day!