17

What are tools/utilities that you should absolutely know while working as a Linux or Windows Sysadmin.

I'm thinking for example about GNU/screen that you'll need if you're working on Linux servers.

HopelessN00b
  • 53,385
  • 32
  • 133
  • 208
paulgreg
  • 4,094
  • 6
  • 31
  • 32

26 Answers26

34

As a Windows Sysadmin, you absolutely need to be familiar with SysInternals. Both for programming and for diagnosing what is going on with a machine, these are invaluable.

Eddie
  • 11,332
  • 8
  • 36
  • 48
29

PuTTY: A great free SSH client for Windows. Just about everywhere I've worked has used this to connect to Unix servers from Windows.

Jon Skeet
  • 4,767
  • 1
  • 24
  • 17
  • 3
    I use PuTTY when I'm using someone else's computer to log in remotely. But on machines I use regularly, I have to install Cygwin/X. There's no substitute to having an X clients display on your own box. – Jon Ericson May 01 '09 at 01:35
  • 2
    +1, PuTTY is made of 99.98% pure Win. – Avery Payne Oct 06 '09 at 20:10
  • Just to add. Lots of people know and love putty. I love introducing them to using Pageant as well. For some reason 75% of people I know who started using putty had no idea Pageant existed until I walked them though setting up their public/private key pair. Now they can't believe they didn't have it before. – Zak Oct 27 '09 at 20:23
  • Also take a look at KiTTY http://kitty.9bis.net/ and MobaXterm http://stackoverflow.com/questions/40453/what-is-a-good-and-free-x-server-for-windows – Vadzim Jan 17 '13 at 15:36
25

vi - I know not everyone likes it, but its pretty much going to be on any *nix server you come across, and when everything else is broken you are going to need to edit config files. I would also suggest csh and sh for the same reasons

Vagnerr
  • 1,265
  • 1
  • 15
  • 20
17

alt text

Don't forget a sysdamin needs to get physical with their computer boxes!

You need to make sure you've got at least one

  1. Philips head screwdriver
  2. Standard (Flat head) screwdriver
  3. Tweesers (to pick up those screws that have fallen into some dark hidden spot on your mobo)
  4. Spare SATA cable
  5. Spare Network RJ45 cable (and cross over cable)
  6. Compressed air -> get rid of all that dust.

Some dude also writes about the top 10 things he/she thinks everyone should have in their toolbox.

Bart De Vos
  • 17,761
  • 6
  • 62
  • 81
Pure.Krome
  • 6,338
  • 17
  • 72
  • 86
14

Scripting.

I learned that even Windows' standard command shell can be really useful. No need to install PowerShell or cygwin to get a decent scripting functionality, especially when the scripts are supposed to be deployed on client machines.

macbirdie
  • 581
  • 3
  • 8
  • 2
    I agree with the importance of scripting, but I wouldn't agree that you can get decent scripting without installing Cygwin, powershell, Perl, or something along that line. Batch files are a frustrating joke compared to a real, full featured, scripting language. – Christopher Cashell Dec 10 '10 at 17:43
  • 2
    Of course a full-featured scripting language is loads better than bat, cmd or vbs scripts. All I'm saying is that the built-in Windows scripting tools are enough for surprisingly many tasks, especially when there is nothing better at hand. It's sort of like the "'Let's use regular expressions!' - Now you have two problems" saying. – macbirdie Dec 11 '10 at 12:05
7

There are a ton of small unix/linux tools that are helpful

grep, strace, GNU Screen, locate, rsync, sed, awk, and tripwire is pretty interesting too.

The list really goes on and on, I'm sure forgot far more than list here. Also, learn about how to configure these tools the way you want, like configuring .*rc files. This will make them all so much more useful. For example, here is my .screenrc file, since you seem interested in screen.

1 startup_message off
2 hardstatus alwayslastline
3 hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]'
4 
5 # Window numbering starts at 1, not 0.
6 bind c screen 1 
7 bind 0 select 10
8 
9 # Default screens
10 screen -t shell1        1
11 screen -t shell2        2
12 screen -t shell3        3
devin
  • 1,226
  • 3
  • 20
  • 27
  • Can you say what the hardstatus string produces? Be nice to see it here rather than decoding the gobbledegook above ... – Hamish Downer May 01 '09 at 12:47
  • very true! It is extremely cryptic. it divides the status line into three parts. on the left is the hostname, center is a list of all the screens with their number and name, the current screen is highlisghted, on the right is the date and time. There's a lot of different colors in there too. – devin May 02 '09 at 04:21
7

Windows Tools:
In recently debugging a multicast problem I was having, I found NMap to be incredibly useful for debugging the network traffic. Wireshark was helpful as well.

6

The perfect companion to PuTTY for Windows users administering remote *nix machines for me is WinSCP, a perfect, small simple and really usable FTP, SCP and SFTP client.

David Heggie
  • 222
  • 1
  • 3
  • 14
5

Powershell! Powershell is a fantastic command shell for windows, built on the .NET framework.

Eric Z Beard
  • 503
  • 1
  • 6
  • 12
5

On any platform you should be familiar with the native, and popular backup tools. Nothing bugs me worse the a sysadmin who doesn't know how to make a good backup. A good backup will save you from almost any mistake you may make.

-ntbackup on windows, dd/tar on Linux -database dump commands -tftp to backup switches/routers/devices

Zoredache
  • 128,755
  • 40
  • 271
  • 413
5

The shell scripting tools: bash/sh, awk, grep, head, tail, less, cat, sort, uniq, wc (and others)

Awk lets you easily analyze log files or other files which is critical when you need to diagnose a problem. Some people use perl for this. You don't need to know everything about either tool, but you should know something, so that you can check that access log or http log and figure out if something unusual is going on.

Combine awk with sort, uniq, tail, grep, and wc to make your life pretty easy.

Mix in some shell scripting. It's super handy to be able to do things like

for i in server1.example.com server2.example.com server3.example.com ; do
  xterm -e "ssh ${i} tail -f /var/log/message | grep something ";
done;

this lets you grep the logs on three servers for something. Tricks like this save you lots of time, and it's all due to the shell scripting tools.

  • you should know of this gem: `for i in server{1,2,3}.example.com ; do`. Shortcuts like this save a lot of typing. – mogsie Jan 09 '13 at 17:12
5

ping traceroute / tracert netstat nslookup

setatakahashi
  • 1,367
  • 2
  • 11
  • 15
4

tail - Available on most Linux/Unix systems lets you view the last lines of a file (or the tail end). tail -f allows you to view new lines added to the file as they appear.

For Windows I like BareTail.

Simon Steele
  • 268
  • 3
  • 6
  • I like less better, just type "F" (shift + f). less will also keep "the right file" tail follows inodes which is a problem when logfiles get rotated at the moment you look at it. – Martin M. Jun 24 '09 at 14:53
  • Using `tail -F` (as opposed to `tail -f`) gives you follow-by-name behavior, instead of follow-by-inode. – Christopher Cashell Dec 10 '10 at 17:45
3

This is probably not the answer you wanted, but I just wanted to share some thoughts. In general system administration is not only about the tools, but also about mental framework you use. In short - if you know what tasks you want to do, then finding a tool to do it is pretty simple.

Basically there are few questions sysadmin has to know about the system:

  1. What do I have? (Hardware, software inventory tools, like rpm, apt, lshw)
  2. How am I doing? (cpu, memory, disk usage, application usage tools, like top, vmstat, sar)
  3. How will I be doing in the future? (monitoring tools, such as nagios, zabbix)
  4. How secure I want to be? (firewalling tools, server hardening tools, like iptables, snort, ids systems, security modules for applications)
  5. What I want my server(s) to do? (tools to manage applications, for example postfix, qmail, apache, java, php and so on).
  6. How to make my life easier? (tools to version config files, deploy configuration into multiple servers, unattended installs)

Now the personal choice of the tools is .. personal.

Btw, the answer about vi is great!

m

Martynas Saint
  • 1,211
  • 7
  • 15
2

A good editor. Doesn't matter which one, I'm certainly not here to start a flame war. But you need to learn a good editor.

I use Emacs for just about everything. Vi(m) is another good one. Not sure about what would be best in Windows, but I'm guessing the Win32 variants of the 2 I mentionned would be good.

Gert M
  • 1,471
  • 1
  • 15
  • 14
  • As pointed out above, vi is available on every single server so knowing that is invaluable when you are in the hosting company. If you can't connect to the internet you can't install your editor of choice, so make sure you can edit config files with what is available and spend half an hour to use vimtutor (type vimtutor at the command line). Although nano is fairly universal aswell, with rather less of a learning curve. – Hamish Downer May 01 '09 at 12:50
2

dmidecode - Excellent for getting all sorts of information about the machine it's running on

strace - for when you can't figure out why the command you're issuing doesn't work the way you wish it did

find - There are more options to this little command than you are probably aware of. Read the man page and be enlightened

xargs - Very, very handy when you need to deal with lists of things

rsync - Knowing rsync and its various options is vital to moving data securely and quickly around your network

telnet - the humble telnet command has probably assisted me in diagnosing more network connectivity problems though the years than any other command

nmap - except maybe nmap

nc - netcat is awesome for setting up quick servers to see what clients are trying to do, or even for "telnet" using udp. Read the tutorials to see how powerful it really is

openssl's s_client Telnet over a secure connection into https servers to diagnose weirdness.

I'm sure there are a ton more I'll remember eventually. Check back for updates ;-)

Matt Simmons
  • 20,218
  • 10
  • 67
  • 114
2

For Windows sysadmin:

Cygwin. Sometimes you just need to do a quick text file grep, wc, awk, or something that would take too long to write as a script. Quick web log scans with grep and awk can really save the day.

spoulson
  • 2,173
  • 5
  • 22
  • 30
2

SysInternals Suite

Click Ok
  • 956
  • 4
  • 12
  • 18
1

Process Monitor especially to troubleshoot Permission problems.

Gulzar
  • 381
  • 2
  • 7
  • 13
1

I'm becoming a huge fan of DTrace, though at this point it's not available for Windows.

Milner
  • 935
  • 7
  • 17
  • Is Dtrace available for Linux? How do you even get Dtrace? – devin Apr 30 '09 at 19:55
  • 1
    Not that I'm aware of, but systemtap[http://sourceware.org/systemtap/] has a beta that is on my list of stuff to play with. It looks like it does similar things that DTrace does, but for Linux. – Milner Apr 30 '09 at 20:36
1

I wonder that no one mentioned VNC.

Xn0vv3r
  • 101
  • 3
1

A few I normally use:

ps: to see the processes currently running
wc: word count. Displays new lines, words, bytes.
grep: find pattern. Match or no match (inverse match)
> for redirecting output to new file or >> to add at the end of a file.
| to chain commands together. Output of first command used on the next one.
tee: writes the input it receives to a file and it also displays the text on screen.

most common chain i use:
ps ax | grep mysql

Nicolas Marengo
  • 266
  • 5
  • 9
1

For Windows, let's not forget NET and NETSH, you'd be lost in networks without them.

Don Zoomik
  • 1,458
  • 9
  • 12
1

Some tools are not mandatory but make the daily life easier:

  • ccze to watch logs in color
  • the moreutils package (deb)
  • cfcat to watch config files without comments
  • wget and how to redirect its ouput
SamK
  • 1,326
  • 3
  • 14
  • 28
0

It has to be SSH and Putty for me: it saves so much legwork & travel it's untrue, and there's no messing with graphical settings or waiting for screen refresh :-)

DutchUncle
  • 1,265
  • 8
  • 16
0

On unix, dmesg. It collects all the system diagnostic messages and displays them nicely on the screen.

And yeah it's been 'obsoleted' by syslogd, but I still havent figured out how to get the syslogd setup to display things as nicely as dmesg does.

Silfheed
  • 168
  • 2
  • 12