# Top 10 Sysadmin Cheat Sheets on Opensource.com

When you're a systems administrator, you don't just have one job.
You have *all* the jobs, and often each one is on-demand with little to no warning.
Unless you do a task every day, you may not always have all the commands and options you need in mind when you need them.
And that's why I love cheat sheets.

Cheat sheets help you avoid silly mistakes, they keep you from having to look through pages of documentation, and they keep you moving efficiently through your tasks.
I've selected my favourite 10 cheat sheets for any sysadmin, regardless of experience level.

# Networking

Our [Linux networking](https://opensource.com/downloads/cheat-sheet-networking) cheat sheet is like the swiss army knife of cheat sheets.
It contains gentle reminders for the most common networking commands, including ``nslookup``, ``tcpdump``, ``nmcli``, ``netstat``, ``traceroute``, and more.
Most importantly, it uses ``ip`` so you can finally stop defaulting to ``ifconfig``!

# Firewall

There are two groups of sysadmins: those who understand iptables and those who use iptables config files written by the first group.
If you're a member of that first group, you can keep using your iptables configurations with or without [firewalld](https://firewalld.org/).
If you're a member of the second group, though, you can finally set aside your iptables anxiety and embrace the ease of firewalld.
Go read [Secure your Linux network with firewall-cmd](https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd), and then download our [firewalld cheat sheet](https://opensource.com/downloads/firewall-cheat-sheet) to remember what you learned.
Protecting your network ports has never been easier.

# SSH

Many sysadmins live in a [POSIX](https://opensource.com/article/19/7/what-posix-richard-stallman-explains) shell, so it's no surprise that one of the most important tools on Linux is a remote shell they can run on someone else's computer.
Anyone learning server administration usually gets acquainted with SSH pretty early, but many of us learn only the basics.

Sure, SSH can open an interactive shell on a remote machine, but there's a lot more to it than that.
For instance, say you need a graphical login on a remote machine.
The user of the remote host is either away from the keyboard or else can't seem to understand your instructions for enabling VNC.
As long as you have SSH access, you can open the port for them:

```
$ ssh -L 5901:localhost:5901 <remote_host>
```

Learn about that, and more, with our [SSH cheat sheet](https://opensource.com/downloads/advanced-ssh-cheat-sheet).

# Linux users and permissions

Traditional user accounts in the style of mainframes and UNIX supercomputers have largely been replaced now by systems such as Samba, LDAP, and OpenShift.
That doesn't change the need, however, for careful admin and services account management.
For that, you still need to be familiar with commands like ``useradd``, ``usermod``, ``chown``, ``chmod``, ``passwd``, ``gpasswd``, ``umask``, and others.

Keep my [users and permissions cheat sheet](https://opensource.com/downloads/linux-permissions-cheat-sheet) handy, and you'll always have a sensible overview of tasks related to user management, and example commands demonstrating the correct syntax for whatever you need to do.

# Essential Linux commands

Not all sysadmins spend all their time in a terminal.
Whether you just prefer a desktop for your work, and you're just starting out on Linux, sometimes it's nice to have a task-oriented reference for common terminal commands.
It's difficult to capture everything you might need for an interface designed for flexibility and improvisation, but my [common commands cheat sheet](https://opensource.com/article/19/11/cheat-sheet-common-linux-commands) does its best.
Modeled after a typical day in the life of any technically-inclined desktop user, this cheat sheet covers navigating your computer with text, finding absolute paths to files, copying and renaming files, making directories, starting system services, and more.

# Git

At one point in the history of computers, revision control was something only developers needed.
But that was then, and Git is now.
Version control is an important tool for anyone looking to track changes to anything from Bash scripts, configuration files, documentation, and code.
Git is applicable to everyone, including programmers site reliability engineers (SRE), and even sysadmins.

Get our [Git cheat sheet](https://opensource.com/downloads/cheat-sheet-git), to learn the essentials, the basic workflow, and the most important Git flags.

# Curl

Curl isn't necessarily a tool specific to sysadmins.
It's technically "just" a non-interactive web browser for the terminal.
You might go days without using it.
And yet chances are strong that you'll find Curl useful for something you do on a daily basis, whether it's a way to quickly reference some information on a website, or to troubleshoot a web host, or to verify an important API you either run or rely upon.

Curl is a command to transfer data to and from a server, and it supports protocols including HTTP, FTP, IMAP, LDAP, POP3, SCP, SFTP, SMB, SMTP, and more.
It's a vital networking tool, so download our [cheat sheet](https://opensource.com/downloads/curl-command-cheat-sheet) for the next time you use Curl.

# SELinux

Linux security policies are good by default, with strong separation between root and user priviledges, but SELinux improves upon upon that using a labeling system.
On a host configured with SELinux, every process and every file object (or directory, network port, device, and so on) has a label.
SELinux provides a set of rules to control the access of a *process label* to an *object* (like a file) label.

Sometimes you need to adjust SELinux policies, or debug something that didn't get set properly upon install, or gain insight into what current policies are.
Our [SELinux cheat sheet](https://opensource.com/downloads/cheat-sheet-selinux) can help.

# Kubectl

Whether you've moved into an open hybrid cloud, a closed cloud, or you're still investigating what such a move will take, you need to know Kubernetes.
While the cloud does still need people to wrangle physical servers, your future as a sysadmin is definitely going to involve containers and nothing does that better than Kubernetes.
While [OpenShift](https://opensource.com/tags/openshift) provides a smooth "dashboard" experience for Kubernetes, sometimes a direct approach is necessary, which is exactly what ``kubectl`` provides.
Next time you have to push containers around, make sure you have our [kubectl cheat sheet](https://opensource.com/downloads/kubectl-cheat-sheet) on hand.

# Awk

Linux has seen a lot of innovation in recent years: there have been virtual machines, containers, new security models, new init systems, clouds, and much more.
And yet some things never seem to change.
Particularly, a sysadmin's need to parse and isolate information from log files and other endless streams of data.
There's still no better tool better suited for the job than Aho, Weinberger, and Kernighan's classic ``awk`` command.

Of course, Awk has come a long way since it was written way back in 1977, with new options and features to make it even easier to use.
But if you don't use Awk every day, all the options and syntax can be a little overwhelming.
Downlod our [Awk cheat sheet](https://opensource.com/article/18/7/cheat-sheet-awk) for the executive summary of how GNU Awk works.

# Bonus: Bash scripting

Cheat sheets are useful, but if you're looking for something a little more comprehensive, you can download our [Bash scripting book](https://opensource.com/downloads/bash-scripting-ebook).
This guide teaches you how to combine all the commands you know from cheat sheets and experience into scripts, helping you build an arsenal of on-call, automated solutions to solve your everyday problems.
It's packed with detailed explanations of how Bash works, how scripting is different from interactive commands, how to catch errors, and much more.

# Enabling sysadmins

Are you a sysadmin?
Are you on your way to becoming one?
Are you curious about what sysadmins do all day?
If so, check out [Enable Sysadmin](http://redhat.com/sysadmin) for new articles from the industry's hardest working systems administrators about what they do and how Linux and open source make it all possible.