Securing SSH with SSHGuard

We all love SSH (Secure SHell). It lets us connect to our remote servers, circumvent firewalls, confuse stateful packet inspection and network monitoring, and otherwise keep nosy entities in the dark about what kind of data we’re shuffling around between machines. However, every server you run SSH on is experiencing hundreds or thousands of attacks every day — most are just brute-force login attempts, but some are more sophisticated attacks.

Here, I’ll show you how to set up SSHGuard, which is a cleverly designed, easy way to harden your SSH installation and decrease the amount of resources that attackers can soak up. It also conveniently works for other services, not just SSH (more on that later). Let’s get started!

Read more

Monitor all the Things (with monit)!

System administrators have a *ton* of different monitoring solutions to choose from. Many of these (Nagios) are forced on them by evil forces who happen to be higher up in the corporate food chain. Some, however, are a joy to use. In this tutorial, I’ll teach you how to use one of my favorites: Monit ( https://mmonit.com/monit/ ). Monit can help you monitor all the same things as the others (CPU and disk usage, etc.), but it also

  • intelligently checks your services to make sure they’re up and responding properly,
  • can react when things go wrong (restarting services, running scripts, etc.),
  • has cool extra features like service management and file-hash checking (to make sure the bad guys haven’t tampered with your system binaries, for example), and
  • is really easy to use.

In this post, I’ll take you from “no idea what’s happening on the server” to “closely monitoring critical services.” Follow along!

Read more

Where to Find Answers to Linux Questions

When they’re faced with a technical problem — an error message, unexpected behavior, or ‘I have no idea what to do about this problem’ moment — most people resort to Google (or a privacy-aware search engine, like DuckDuckGo or IxQuick). However, often this is not the quickest way to get the problem solved.

Here’s a quick checklist of resources for solving Linux problems:

Read more

Finding out what’s happening on a Linux Machine

Here’s a quick video on finding out what’s going on when you log into (or sit down at) a Linux machine. We cover the following commands:

w (/who): find out who is currently logged into the machine, and where they're connecting from

top: find out which processes are running, how much load they're putting on the CPU, and how much memory they're using.

(sudo) netstat -tulpn: Check for listening network ports and which processes/programs are using them.

Some Alternatives to the Tools I show in this Video:

I really like a program called htop, which shows you a bit more information and presents it in a nicer format. I recommend using it, once you’re comfortable with top.

htop (sudo apt-get install htop -- quit with 'ctrl-c' or 'q' once it's running)

Have fun!

The Absolute Basics: Set up a Linux Virtual Machine and get started

Everyone has to start their Linux System Administration journey somewhere. If you’re ready to dive into Linux, here are the absolute basics.

Install Linux in a Virtual Machine

First things first: you need to get a learning environment set up for yourself: a place where you can make mistakes, explore things, and hack the matrix without destroying your day-to-day environment. The answer? A virtual machine! Here’s a video detailing how to set up a Linux virtual machine:

 

Get Started on the Linux Command-Line

Next, the fun part — jumping into the command-line! Open up a terminal in Ubuntu (by pressing the windows key to bring up the application launcher, and then typing in ‘terminal’ to bring up the application), and let’s get started with your first few commands:

At this point, you’ve got your learning environment set up. You’re probably excited to dive in and begin learning, but take a few minutes to play around with Linux until you’re comfortable using the Graphical User Interface (GUI), and typing in the basic commands we’ve discussed so far.

From here, you can continue the Linux Sysadmin Basics YouTube playlist!