The Ubuntu for Network Engineers

A guide to network engineering with Ubuntu

The Ubuntu for Network Engineers

If you find this post useful please, consider sharing it and leave a comment if you think there is something that needs to be added or removed. Please consider sponsoring us if you can, see details at the bottom of this post!

The following conventions are used in “Ubuntu for Network Engineers”:

  • Italic
    • Used for URLs, email addresses, acronyms, filenames, and new terms.
  • Constant Width (Consolas Typeface)
    • Used for program listings and terminal command output
  • Constant Width Bold (Consolas Typeface)
    • Text that should be typed into the terminal
  • Constant Width Italic
    • Text that should be replaced by user supplied values
  • Introduction - Introduction to Ubuntu
  • Chapter 1 - Using Ubuntu
  • Chapter 2 - Installing Tools

Introduction

  • Who is this guide written for?
  • Why use Ubuntu?
    • As a Network Engineer it Rocks
  • Open source software and the community
  • Open Source In Cisco Products
  • NetDevOps Certifications
  • Linux Certifications
  • Installing Ubuntu

Who is this guide written for?

Any technical user running Microsoft Windows who wants to try Linux! I used MS Windows from Windows 3.1 up until Windows 8 came out. At that time I had been using Linux for things like Nagios and the Asterisk VoIP system but not on my laptop. Windows 8 pushed me over the edge!

Once I started working with Python and studying for the Cisco NetDevOps certification, it became clear that Linux is a better choice for a technical user, whether they are a network Engineer, administrator or developer. Tools like nmap work better under Linux (raw socket support), you have access to sophisticated terminal emulators like Terminator, Alacritty, Tilix, and different shells (what most people call "the Terminal"). This guide will show you how to switch from BASH to ZSH in a later chapter.





  • Network Engineers can use this guide to get started with Linux and then to customize their daily driver to fit the unique needs of a network engineer.
  • Network Administrators will find Unix tools like grep, sed, awk, and arp-scan useful in their day to day operation. These tools are discussed in "Working in the Terminal".
  • Security Personnel will find a plethora of open source tools available for Linux. Many of these tools are discussed in the DNS chapter and in the networking tools chapter.
  • A Curious student who wants to learn about Linux, Open Source, and NetDevOps.

This guide is written assuming that you have skills in MS Windows, Putty, Network devices, and a desire to learn how Linux can make you a better, more efficient engineer.


Why use Ubuntu?

I helped a college student who is studying data science switch to Ubuntu recently. Our conversations had all been over text. I had the chance to meet him in person a month or so later and I asked him if he stuck with Ubuntu. His response was an enthusiastic Yes!

I have been using Linux for quite a while so his next comment caught me off guard. He said "I love how there are no ads and nothing pops up in the start menu." There were more comments about how "clean" the Ubuntu interface is. I didn't realize how bad Windows 10/11 home edition are with the constant ads and pushing MS software.

As a Network Engineer it Rocks

Network Engineering is moving to a NetDevOps model and away from the CLI. This means using Python, Ansible, Git and other DevOps tools. Ubuntu is the OS that Cisco recommends for the DevNet certifications. In fact Cisco is so strong on Ubuntu that they released an Ubuntu image for the DevNet Expert course. There is no reason not to use it for learning Linux. It's available as an OVA for VMWare Workstation and a QCOW2 for Linux.

Download it here: Cisco Certified DevNet Expert (v1.0) Equipment and Software List

Here is an image from the Cisco DevNet Associate course. You can see the emphasis on coding and automation.

Cisco DevOps Topics


Open source software and the community

Ubuntu is a Linux distribution published by Canonical in the UK. There are both desktop and server versions. Ubuntu is Open source software meaning that the source code is available on the Canonical website. If you are coming from Microsoft Windows it's hard to wrap your mind around that! You will hear Open source software called Free, Open Source Software (FOSS) or Libre Software. In this case the "free" refers freedom, not zero cost.

What I love about Ubuntu is the "Open Source Software" community. It is a large community of developers, users, engineers who love creating software, hardware, and sharing it. Some examples of Open Source Software include:

  • FireFox
  • MariaDB
  • OpenSSH
  • OpenSSL
  • Apache
  • Nmap
  • KeePassXC
  • Python

Just to name a few!

Open Source In Cisco Products

From Cisco's website: Cisco values the open source community as an essential resource and partner in innovation. Here you can find information on the open source used in Cisco products.

Cisco is a Leader in Open Source Innovation

Open source is changing the technology industry and Cisco is a dedicated partner in that innovation. Cisco has been participating in open source development for nearly 3 decades, including founding projects like OpenDaylight, FD.io, VPP, PNDA, SNAS, and OpenH264, and contributing to projects like OPNFV, Kubernetes, OpenStack, Ansible, Chef, Puppet, Maven, and countless more.

There are pages and pages of links to the Open Source software that is used in Cisco products.

Why am I bringing this up? Because when I started using Linux I just saw it as a tool. But now that I am a few years in, I see that it is the foundation of modern society. Almost every switch, router, firewall, public web server, surveillance camera, etc. runs on Linux and uses Open Source software. Once you start using Open Source software you really feel like part of the community.


NetDevOps Certifications

Cisco and Juniper both have certifications for NetDevOps. They both have a substantial amount of free training material available. I have a repository with information on each program. If you are interested in working on either certification you can find the repositories here:


Linux Certifications

The Linux Professional Institute (LPI) offers several different certifications if you are interested. The Linux Essentials is a good one to start with. It is more about the Open Source philosophy and the history of Linux than a deep technical certification. LPI has free certification materials on its site.


Installing Ubuntu

This document is meant to get you up to speed with Ubuntu quickly. The first question is should I just spin up a virtual machine or use bare metal? I used Linux for a few years as a VM before I bought dedicated hardware.

The advantage of using a VM is that if you damage it or decide for any reason it’s not the right distribution you can just delete it and try another one. The drawback to a VM is that the hypervisor hides the hardware so you don’t get the experience of installing, configuring, and maintaining Linux.

My suggestion if you have never touched Linux is to install Ubuntu as a VM and get some experience with it. You won’t have to spend any money, Ubuntu is free, although I usually donate $10 when I download it to install on a fresh machine, and you can run any of the tools in this book.

I have Kali running on a 2015 MacBook Pro and Ubuntu on a Dell G5 laptop. I did this because I wanted to get my Linux certifications and I felt that I needed to be running Linux on my daily driver to learn. The VM can do just about anything the bare metal can do but when I would get stuck on something I would just shut it down and go back to Windows instead of figuring it out. Running on bare metal removed the temptation to do that!

There are a lot of good tutorials on installing Ubuntu available on the Internet so I am not going to cover it here. It is actually very easy, pretty much click, click, next, reboot! The site linux config has a lot of great Ubuntu tutorials, here is a link to a tutorial on installing 22.04 – How to install Ubuntu 22.04 Jammy Jellyfish Desktop. If you want to install Ubuntu 22.04 on bare metal the Lenovo x280 is a good choice. They are under $200 on ebay in good condition and have hardware that is supported on Ubuntu. You can also use the Ubuntu Search Ubuntu certified hardware site to verify that the hardware you want to use will be well-supported on Ubuntu.

NOTE: Ubuntu has two types of releases

  • LTS releases - Every two years on even years. So 22.04 is the long-term release from 2022.
  • Interim Releases - Released in October and April. So 22.10, 23.04, and 23.10 are interim releases after the LTS 22.04. The next LTS will be 24.04.

The LTS releases are rock solid but they don't get new features or the latest kernel versions. If you put Ubuntu on bare metal and use it as your daily driver I recommend that you use an LTS release.

Appendix A covers the installation I did on a Dell G5 laptop that wasn’t 100% compatible out of the box. It took a lot more time than I expected to get everything working on the Dell and I documented the steps in the Appendix. Dell and System 76 both sell laptops with Ubuntu pre-installed.

Even if you buy a System 76 or Dell laptop with Ubuntu preinstalled you may still want to take a look at the Appendix since I documented some things like customizing the Grub boot loader and running nVidia and Intel graphics.

In this guide, I am going to document the tools that I found useful in the transition to Linux for network engineering tasks.

A note on encryption. Ubuntu supports the Linux LUKS full disk encryption. During setup, you can select the encrypt full disk option. This is, of course, a good idea for security but if you encrypt and then decide you don’t want it you will need to decrypt the disk. Use the instructions here to decrypt the LUKS volume: How to remove LUKS encryption

  • Using Ubuntu
    • Desktop Environments in Linux
    • Podcasts on Linux
    • Casting your display
    • Working with Applications
      • The Super Key
      • Search for an application
      • Switching Applications
      • Viewing all installed applications
      • Switching between multiple open windows in the same application
    • Configuring the Dock
    • Customizing Gnome - The Tweaks Tool
      • Startup Applications
    • Managing Files
      • Creating archives
      • Display the Full path in files
      • Easily preview files in Files
      • Search
      • Why do I have a red Lock on a file or folder?
    • Creating a bootable USB stick from an ISO image
      • Use dd to make bootable flash
      • Use the Ubuntu "Make Startup disk" tool
      • Use qemu to test a startup disk
    • Working with the Linux File System
      • LSBLK
      • LSUSB
    • SSH
      • OpenSSH Server
      • Creating SSH Keys

Using Ubuntu

Switching from Windows to Ubuntu with the Gnome desktop is easy and hard. How can that be? It's simple, the basic operation of the desktop is similar to Windows. The file manager (Files) is similar to Windows Explorer and of course, Chrome or Edge work just like they do in Windows including syncing, extensions, etc. There is a keyboard button called the superkey (on most keyboards it will have the Windows logo) just like the Windows key. You tap it and search for an application or pick from the running applications.

So, what is the hard part? Things like killing a hung application, searching for files from the terminal, and checking free disk space are different and will take a little getting used to. It's a lot like working on Cisco IOS for years and then having to work on an Aruba or Juniper switch. At first, it's frustrating, you have to look up commands and it's frustrating.

The reason for this guide is to help get you past the hurdles so that you can start enjoying Ubuntu. I promise that if you get over the hump your productivity as a network engineer will soar. Since MacOS is based on Open BSD Unix, once your muscle memory is up to speed you can jump back and forth easily between Windows, Mac and Linux. In a later chapter I will discuss the terminal tools that make Linux so much fun and so powerful for a network engineer.

Desktop Environments in Linux

One of the big advantages for Linux is that you can customize almost everything since it's open source. You can change the terminal you use, the file manager, the way almost anything works and even the desktop itself.

The first choice you have to make with Ubuntu is which Desktop Environment do you want to us. The two most popular desktop environments (DE) for Linux are Gnome (Ubuntu’s default), and KDE (which is available on Ubuntu) but there are many more. I use the computer for work and just learned to customize Gnome to fit my workflow but I use Terminator for my terminal app. Here is a TecMint article on Desktop Environments. My advice is to start out with the standard Ubuntu with Gnome until you some comfort with Linux.

I listen to a lot of podcasts and KDE Plasma, XFCE and MATE are highly recommended desktop environments (DE) that you may like better than Gnome. If you watched the second episode of Mr. Robot (Season 1 – which I highly recommend) there is a scene were an executive tells Elliot that he runs KDE but understands why Elliott prefers Gnome.

These two short YouTube videos sum it up better than I can:

Podcasts on Linux

There are a lot of podcasts dedicated to Linux. In your podcast application just search Linux. My favorites are:

  • Destination Linux - A weekly podcast on general Open Source topics.
  • Linux Unplugged - A weekly podcast on Linux by Jupiter Broadcasting. Covers news and applications for Linux.
  • Late Night Linux - A weekly podcast on Linux and the wider tech industry.
  • Linux After Dark - A weekly podcast on Linux experiences.
  • Linux Downtime - A weekly podcast "From working in the Industry and progressing your career, to managing a projects community"
  • This Week in Linux - A weekly podcast on Linux

Casting your display

I have a Vizio “Smart” TV with Chromecast built in. Using the Chrome browser I can click the three dot menu on the right and select “Cast...” to send the output to the TV.

In VLC, select “Playback, Renderer” to send VLC’s output to the TV. I don’t have a Chromecast dongle, but I am guessing it would work the same way as the Vizio TV.


Working with Applications

Like in Windows, there are many ways to open applications in Gnome.

The Super Key

You can hit the Windows key (Superkey is what it's called in Ubuntu) to bring up a search box.

Show open applications

Notice that the files application icon has two dots on the left side. If you click on the icon, the screen will change to show the two files windows.

Show multiple windows of the same application

Search for an application

To open an application using search, simply start typing the name of the application in the search box. As you type, all the matching applications will be displayed below the search box. If the one you want is the first one displayed on the left you can just hit enter. If not, keep typing and the list of displayed applications will get smaller. In the screenshot below, hitting enter will open the built in calculator app. Right arrow, Enter will open LibreOffice Calc!

Application Search

You can also use the mouse and click on any application that is displayed to open it.

Switching Applications

Tap the super key (Windows key on some keyboards). Below the search box are the applications that are currently running. If you want to switch to one of the open applications, you can use the Tab key and [enter] or use the mouse to select one of the running applications.

You can also use ctrl+tab just like in Windows.

Finally, you can use the dock to open applications that you have pinned to it.

Viewing all installed applications

The dock has a small icon at the bottom, it’s three rows of three dots. You can click that icon to see the installed applications in a window.

Dock icon to show all applications

If there are too many to display, a column of circles will appear at the bottom of the screen and arrows on the right side. You can scroll down with the mouse button or click on one of the circles to jump to the next page. As you can see, it’s very easy to open applications in Ubuntu.

Installed Applications

Switching between multiple open windows in the same application

If you have several copies of the same application open you can switch between them using the super key and `~ key (the key to the left of 1 on a US keyboard). You can also bring up the dock, click on the application icon and then select the one you want but the keyboard is much easier and faster.

For Example, in LibreCalc I often have a lot of spreadsheets open. To switch to a different sheet I can use the "alt+`" key combination. Here is a screenshot of two spreadsheets.

Switch between windows of the same application


Configuring the Dock

Like Windows and Mac, Ubuntu with the Gnome DE has a dock. You customize the dock using the Gnome Settings app. To open the Gnome Settings application, click on "Activities Overview" icon at the top right corner of the screen, then select the gear icon. This will open the "settings" application. It’s very similar to “System Preferences” on the Mac or Control Panel on Windows.

At the top left corner of the screen there is a magnifying glass. Click it and enter "dock". The dock is under "Ubuntu Desktop".

Dock Settings

One thing I do to help me use all three operating systems is to customize the dock to be similar across all OSes. I set Windows, Mac and Linux to display it on the left because I am almost 100% of the time on a laptop and the screen is wider than it is high. I also set the dock to auto-hide and display a few commonly used apps.

Using the super key and typing the first few letters is now my preferred work flow rather than clicking on an icon in the dock. One thing I like about Ubuntu is that when I’m using multiple monitors it puts the dock on all the monitors.

Customizing Gnome - The Tweaks Tool

Ubuntu ships with Gnome as the desktop environment (DE). Unlike Windows, Linux distributions can use a lot of different desktop environments (DE). Gnome is the default desktop environment for Ubuntu and Redhat (CentOS) so it has a large percentage of the desktop market in Linux. If you want to try others there are several official flavors of Ubuntu that you can download from Canonical.

First, install the Gnome Tweak Tool. This tool allows you to change a lot of the Gnome settings to your preference. Open a terminal window, ctrl+alt+t, and type the following:

sudo apt install gnome-tweak-tool

Press [enter], you will be prompted for your password because of sudo, and the install will start. When it finishes, hit the super key, type

tweaks

and hit [enter].

Gnome Tweaks tool

Startup Applications

Gnome Tweaks is where you set the applications that run on startup. I try to keep these to a minimum. It's easy to forget that some application is automatically starting and you have forgotten about it.

There are a lot of options that you can "tweak" with the tool. I don't make a lot of changes but I do like having the Top Bar show Day, Data and Time.


Managing Files

Files is the file manager for Gnome. The Gnome team is very creative with application names! The text editor is named "Text Editor", I kid you not. It makes Googling for tips a bit of a challenge.

Files works well and has a feature I love – Tabs! Once you get used to having tabs in your file manager it’s hard to use Windows Explorer! Here is a screenshot with three tabs open and the right click menu showing “Open in Terminal”. You can see how convenient this is.

On a Mac, the Finder app has the tabs. I don’t know why Windows doesn’t. Files has an extensive right click menu. Here are the options for the folder Scripts.

Right Click Menu

Creating archives

From the right click menu you can select "Compress..." to create a zip, password protected zip, a tar.gz or if you have installed 7zip, a 7z archive.

Display the Full path in files

Sometimes you want to copy the full path to a file when working in the file manager. Hit ctrl+l (lowercase el) and the path will change to a format that you can copy.

Display full path in files

Easily preview files in Files

One thing I missed from Windows Explorer was the preview pane. In Ubuntu running the Gnome desktop you can install "Sushi" to preview files. Then you just hit the space bar to preview a supported file format.

How to Quickly Preview a File in Ubuntu's File Manager (Like "Quick Look" in macOS)

Search

NOTE: I said that you should use the LTS version of Ubuntu in the first chapter. And I usually do, but Ubuntu 23.10 includes Gnome 45 and I had to have some of the features. And 24.04 will be out in six months!

One of the features that I wanted was the completely new "Files" application that is amazing. Here is the announcement from the project Introducing GNOME 45, “Rīga”

One of the best features in Files is the new search. Just click on the magnifying glass next to the address bar and enter some text. Unlike in Windows, you can enter text that is in the middle of the filename. In the screenshot below, I entered "new" and it found "frequent-new.png" in a directory one level down.

Search for for files

You can click on the funnel icon after you open search and filter on:

  • Date
    • Created
      • Last Modified
      • Last Used
  • What - There are well over 100 file types to choose from
  • Full Text or Filename

Ubuntu has an article on using the new feature here: Search for files

Ubuntu also has a Common Tasks page for Files

Why do I have a red Lock on a file or folder?

Files, like every other GUI file manager, uses icons to represent files and folders. If the icon has a green check mark in it, you have full access to the file or folder.

If the icon has a red lock in it, you don’t have full permissions to the file or folder. Here is a screenshot of Files showing one file with a green check mark and one with a red x.

File that you don't have permissions to

To take ownership of the file open the terminal and enter:

sudo chown mhubbard testsync.txt

You will be prompted to enter your password.

Reference

Meaning of files-folders with a red x


Creating a bootable USB stick from an ISO image

You don't need a third-party tool to create a bootable USB stick on Linux if you don't mind using the terminal.

Use dd to make bootable flash

NOTE: Ubuntu uses a system called "snaps" to sandbox applications. The drawback to snaps is that they mount every application using a "squashfs". I use the following alias so that I don't have to see all the applications.

alias df="df -h --exclude=squashfs"

I will show you how to create aliases in a later section.

If you create the alias you can use df -h instead of including the --exclude=squashfs option.

  • run df -h --exclude=squashfs
  • Insert the flash drive
  • run df -h --exclude=squashfs

Look for a new entry in the table. For example, on my laptop I have two flash drives mounted.

Filesystem      Size  Used Avail Use% Mounted on
tmpfs           3.2G  4.0M  3.1G   1% /run
/dev/nvme0n1p2  457G  392G   43G  91% /
tmpfs            16G  219M   16G   2% /dev/shm
tmpfs           5.0M   12K  5.0M   1% /run/lock
efivarfs        384K   80K  300K  21% /sys/firmware/efi/efivars
/dev/nvme0n1p1  513M   31M  483M   6% /boot/efi
tmpfs           3.2G  1.3M  3.2G   1% /run/user/1000
/dev/sdc1       7.5G  4.1G  3.5G  55% /media/mhubbard/C253-EE9A
/dev/sdb1       116G  5.0G  111G   5% /media/mhubbard/LINUX-ARCHI

The two flash drives are /dev/sdc1 and /dev/sdb1. I can tell because they are listed as /media/mhubbard which is the mount point for the flash drives.

In this example I am burning System Rescue to the flash drive. Parameters:

  • if - input file name
  • of - output filename
  • bs - Block size to use
  • status=progress - display progress
  • && sync - In Linux the "&&" means finish the first command then run the next command. In this case sync the writes to make sure it's ejected cleanly Enter the following:

dd if=systemrescue.iso of=/dev/sdb bs=10M status=progress && sync

NOTE: dd is commonly referred to as "disk destroyer", meaning that it starts as soon as you hit enter, there are no "Are you sure" prompts.

MAKE SURE THAT YOU HAVE THE OF (output file) SET TO THE FLASH DRIVE!!

Use the Ubuntu "Make Startup disk" tool

You can use the built in “Startup disk creator” by tapping the super key (Windows Key) and typing start. You will see the Startup disk icon:

Startup Disk Icon

  • Pick the ISO image from the “Source disc image (.iso)” drop down
  • Then select the USB stick from "Disk to Use"
  • Click “Make Startup Disk”
  • You will be prompted to select "Yes or No"

Startup Disk Interface

In this example, I am burning Kali Linux 2023.3 to the flash drive.

Use qemu to test a startup disk

You can install qemu and create a simple virtual machine to test a startup disk. I'm not going to cover that but these two articles will explain.


Working with the Linux File System

If you have been a Windows user for a long time the hardest part of switching to Linux is the file system. There is no concept of drive letters in Linux. The Linux file system is based on the “File system Hierarchy Standard” maintained by the Linux Foundation.

The top of the Linux file system is called the root. All files and directories are referenced from the root, even if they are stored on different physical or virtual devices. That is so different from Windows that it will take some time to get comfortable with.

Here is a link to a great tutorial on the Linux file system by Abhishek Prakash - Linux Directory Structure Explained for Beginners. His tutorial will get you up to speed on the Linux file system. Abhishek creates Linux tutorials and I recommend that you sign up for his newsletter. The subscribe button is at the top of the page.

On Windows you have drive letters and the root of the file system is the “\” character – The good old C:. But Linux/Mac, or any *NIX for that matter, doesn’t use drive letters. The file system is usually described as a tree with root at the beginning. Root is shown in the file system as /. Everything is then displayed off the root. The “/” is another difference that will take a while to get used to. Unix/Linux/Mac use a forward slash instead of the backslash “\” for file system commands. When you use a web browser, you use the forward slash for file commands – https://github.com/rikosintie for example.

LSBLK

For a quick look at block devices (hard drives, thumb drives, nvme, etc.) on the system, you can use the "list block devices" command - lsblk. Here is an lsblk listing on my Dell laptop which has an m.2 NVME drive with the OS on it and 1TB SSD for data.

$ lsblk -e7
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 931.5G  0 disk /media/mhubbard/Data
nvme0n1     259:0    0 465.8G  0 disk
├─nvme0n1p1 259:1    0 513.1M  0 part /boot/efi
└─nvme0n1p2 259:2    0 465.3G  0 part /

Notice that I included -e7 on the end of the lsblk command. That is because Ubuntu uses "snaps" for a lot of applications and the show up as "loop" devices in lsblk. The -e means exclude and 7 is the number loop devices.

So you can see that I have an NVME drive called nvme01n1. There are two partitions on the nvme drive:

  • nvme01n1p1
  • nvme01n1p2

P1 is the boot partition and p2 has the operating system. Notice that nvme0n1p2 is type partition and mount is /. That means nvme0n1p2 is the root of the file system.

There is also a "block device" named sda. This is a 1TB SATA SSD drive and it's mounted at /media/mhubbard/Data off the root.

Disks in Files

The display needs a little explanation. For the disk labeled “Ubuntu” it says 45.4 GB / 490.6 GB available. That actually means it’s a 490.6GB drive with 45.4GB available.

Once you get used to it, this seems more intuitive and easier to scale than the drive letter model used by Windows. You will also notice in the lsblk output that Linux/Mac, and again all *NIX systems, use the forward slash as a delimiter rather than the backslash.

Linux has many “ls” commands for listing things:

  • lsblk – list block level devices like disk drives, thumb drives, etc.
  • lspci – list the PCI bus devices on the system
  • lsusb – list USB bus devices
  • lsof – list open files
  • lslogins – list logins
  • lsmod – list the status of modules inserted into the kernel

I will cover each of these a later in this section.

To list the commands that start with "ls" you can type ls and press [tab]. This works with any Linux command. Just like in a Cisco switch, Linux has "tab completion" but it will also show you a list f all commands that match.

$ ls
ls           lsattr       lsb_release  LSCOLORS     lsdiff       lsinitramfs  lslocks      lsmem        lsns         lspci        lspgpot      lsusb
lsa          lsblk        LS_COLORS    lscpu        lshw         lsipc        lslogins     lsmod        lsof         lspcmcia     lspower

LSUSB

lsusb Linux makes it easy to see what USB devices are connected, who the manufacturer is and what the Product ID (PID) and Vendor ID (VID) are.

In this example, I have a USB to Serial adapter connected. It uses the Future Technology Devices International (FTDI) UART. It’s connected to Bus 001, the Vendor ID is 0403, and the Product ID is 6001.

lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0c45:6a08 Microdia
Bus 001 Device 003: ID 8087:0aaa Intel Corp.
Bus 001 Device 006: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

This is a very useful command once you make it part of your skill set. Anytime you connect a USB device you can quickly see who the manufacturer of the chipset is. This is especially useful if the device isn’t working correctly and want to Google for some information.

Another command that will help here is dmesg. This displays the system messages that have been logged. With the lsusb command above you can see a Future Technology USB-Serial adapter has been inserted.

If I run:

dmesg | grep FT232
[83003.234941] usb 1-3: Product: FT232R USB UART
[83003.242719] usb 1-3: Detected FT232RL
[106493.653320] usb 1-3: Detected FT232RL

You can see that the system logged the insertion of the UART. To see what kernel module is loaded for the UART (Note – I am only showing the UART module. Other USB kernel modules were displayed):

lsmod | grep usb
usbserial
49152 3 ftdi_sio

In this example the Future Technology USB-Serial adapter is working correctly but you would do the same things to troubleshoot a device that wasn’t working. The big difference over Windows is that support for a device in Linux is built into the kernel and loads when the device is inserted.

There are cases where there is no support in the kernel and you will have to go to the manufacturer’s site and download a kernel module (driver in Windows).

The steps above will quickly let you know that the device isn’t being discovered by Linux


SSH

*nix systems have SSH installed by default. Newer versions of the OpenSSH client don’t allow weak ciphers.

I highly recommend SSH Mastery by Michael Lucas. It’s available at SSH Mastery or Amazon. When I switched to Linux my only experience with SSH was Putty. There is so much more to SSH and Michael explains all of it.

OpenSSH Server

Ubuntu comes with an SSH client. If you want to be able to ssh back into your laptop or send files to network devices using SCP you need to install and configure the Open-ssh server. Follow these instruction to enable the SSH server:

sudo apt update
sudo apt install ssh

Useful SSH system commands

  • sudo systemctl start ssh - Start the SSH server
  • sudo systemctl stop ssh - Stop the SSH server
  • systemctl status ssh - Show server status
  • sudo systemctl disable ssh – disables SSH server after next reboot
  • sudo systemctl enable ssh – enables SSH after the next reboot.

Reference:

How to Set Up and Use SSH in Linux

Creating SSH Keys

The OpenSSH client allows you to create SSH keys. My current recommended cipher is Bruce Schnierers ED25519. To create a set of keys using ed25519 run the following in the terminal from the ~/.ssh directory:

ssh-keygen -o -a 100 -t ed25519

-o Use the new RFC4716 key format and the use of a modern key derivation function powered by bcrypt.

-a 100 Use 100 rounds of pbkdf2 (password based key derivation 2)

-t Specifies the type of key to create. The choices are dsa | ecdsa | ecdsa‐sk | ed25519 | ed25519‐sk | rsa

Specify a strong passphrase when prompted. The passphrase is required anytime you use the key. If you don’t password protect the key, and an attacker gets access to the keys, they can log into any server you used them on.

Check the existing keys on your system

for keyfile in ~/.ssh/id_*; do ssh-keygen -l -f "${keyfile}"; done | uniq

  • DSA or RSA 1024 bits: This is a red flag. Unsafe.
  • RSA 2048: This is a yellow flage, recommended to change
  • RSA 3072/4096: great, but Ed25519 has some benefits!
  • ECDSA: depends. Recommended to change
  • Ed25519: wow cool, but are you brute-force safe?

Here is what it looked like on my laptop. Looks Like I have some key generation to do!

$ for keyfile in ~/.ssh/id_*; do ssh-keygen -l -f "${keyfile}"; done | uniq
2048 SHA256:YRwfm94a26cfCQZK6mT3SO29XaLoAHWJgnixN2OZDM0 mhubbard@1S1K-G5-5587 (RSA)
2048 SHA256:WFuzqdjjnEVd+tW+2fKz1dEKVzK+vfjhgvsCGlSZrrk mhubbard@1S1K-G5-5587 (RSA)

Reference

Upgrade your SSH keys! - In this post I'll demonstrate how to transition to an Ed25519 type of key smoothly, why you would want this and show some tips and tricks on the way there.

What's Your Reaction?

like

dislike

love

funny

angry

sad

wow