Top Ten Linux Configuration Tools?
jman251 asks: "I am presenting at a conference in September on a couple of Linux-centric topics. One of these is a collection of tips, tricks, and tools for configuring, securing, and maintaining a Linux-based server. I have a short list of tools I use, but would like some community input on the subject. What tools do you use that make your admin responsibilities easier or more automated on the Linux platform?"
I use it on several of my servers to do basic configuration.
Your thin skin doesn't make me a troll
My at least top 4...
grep
gawk
xargs
for
Sig (appended to the end of comments you post, 120 chars)... oops
Tripwire is a very easy to use intrustion detection system. If you follow the documentation, and implement it properly (storing the statically linked binary + database files on read-only media), it will make things very hard on a potential hacker.
cfengine (http://www.cfengine.org) is
the best automation tool for unix and unix-like
environments. Hands down.
It's a little hard to configure sometimes, but
worth the effort.
sudo!
Learn it in detail. If you work with other people on the same machine, it will make your life a lot easier.
screen is pretty handy, too. Being able to detach sessions is also nice for when you've started sprouting icycles from your nostrils from the cold, cold server room.
That's all I can think of now. I'll think of others later.
I can't believe with all these posts that the only one(s) that actually respond to the question are about Webmin!
Don't get me wrong, Webmin is great, it's at the top of my list fer shure, but that's not the be-all and end-all of systems management!! What about actual convenient tools like MRTG, Novell's eDirectory, RedCarpet, etc. etc.?
Heck, I'm reading this article hoping to pick up a few tips myself and all I'm seeing are scripting languages and text-editor flame wars, (all of which can/should be moderated Off-topic or Funny).
So, anybody actually got anything useful to contribute besides Webmin?
Also, it kills me to see *NIX people still using passwords all the damn time. CVS + ssh keys = godlike.
/usr/local over nfs is good too. The only issue is that you may have to configure some packages to use a local filesystem for configuration files, keys, etc.
:)
Things I do. syslog to a common place. I have cloning scripts to dup a machine to a basic setup (poor mans jumpstart but faster and easier).
Perl and sed come in handy. Rsync (again with ssh keys) is good.
Oh yeah,
With these tips and tricks I can do whatever I need to do over a dialup connection anywhere in the world (I've only tested this from coast to coast in the US thought, but I believe it will scale worlwide
vimr l
sudo
apt-get
wget
rsync
ssh
ps
php
pe
make
Jason Lotito
There are four of us who do *nix admin for over 600 *nix machines, more than half of which are linux boxes (both workstations and servers.) SSH with X displayback on a 100Mbit switched network is such a godsend I can't even begin to imagine life without it. I probably generate more SSH sessions in a normal workday than I do HTTP sessions. (Yes, that does include
I also think it's well worth your while to understand SSH's more esoteric tunneling capabilities... Recently I had to support a research group who was doing a demo at JPL and they were behind a very restrictive firewall but needed to do control and image transfer from a robot framework here in Massachusetts, and the researchers who'd coded the software hadn't implemented any kind of authentication layer. We were able to do everything using SSH tunneling over one of the three ports allowed through JPL's firewall (and they could IMAP their mail from our servers as a side bonus) without exposing our servers or JPL to unencrypted protocols of any kind.
Need a UNIX/Linux/network guru in the Boulde
su -- better sudo keeps your root password better kept, does more logging, etc
more -- better less (Its not the 70s anymore people, you can search and go backwards in files since less first came about in the mid 80s. With the LESSOPEN varible set to something useful you can "browse" many, many filetypes too).
bash -- better zsh My shell can do anything your shell can do, but better!
1. Nagios: monitors your servers/services, amails, pages, sends a carrier pigeon when one goes down.
2. Logwatch: Logwatch is something that should be used by every Unix/Linux SA everywhere. It gives you a daily snapshot of events in your logs
3. Mon: Nice, simple, easy. If your webserver goes down, your secondary can bring up a virtual ip a couple of seconds later. No more annoying three am phone calls
4. Snort/ACID: lets me know if a virus breaks out, or if there are stupid script kiddies trying to brute force their way in.
5. Nessus: run it early, run it often. Figure out any holes you have in your security, and make sure you fix them.
There's more, but you should really do some of your own homework.
RandomAndInteresting.comdefending the world from stupidity since 1979
So now "rm -fr /" won't work even as root as it will properly give you :
So there you are, you pesky root of all evil. Oh bummer, now I can't make any new files in /home/dude ....
Whilst you are correct this works for non-interactive processes, you can't use nohup to keep a copy of say, Lynx, running when you logout. Then return to it later and pick off where you left it.
Instead you should look at GNU Screen which allows this and more.
(It's essentially a windowing system for consoles, with the ability to detach and resume at will, and definately one of my top ten Unix utilities).
Here is one Screen tutorial which explains basic operation well.
what are the advatages of zsh over bash
1) programable tab completion - yes folks there is more to tab completion besides beeping all the time. When I hit cd fooTAB the list of completions only shows _directories_ beginning with foo
2) sane invocation - zsh is the only shell that has one file that is sourced _on all invocations of the shell_ so you can do stuff like have a consistant PATH and other env stuff
3) global aliases - zsh provides an alias that works _anywhere on the commandline_ I have 'G' mapped to '| grep -i', I have 'L' mapped to '| less' and 'vi' mapped to 'vim' (why? So sudo vi FILE gives me vim if the system has vim), etc, etc
4) the only shell that supports working 'vi' style history editing
5) multiple commandline commands are not rewritten as commands with ';' in them (what I typed is what I get, see 4)
6) too many features to name. Like I said, my shell can do anything your shell can do, but better.
we at the university of michigan use radmind to update and deploy software to our linux environment. it is a great tool that helps us centrally manage our environment and rapidly deploy security updates. update one machine, take a snapshot of the differences, and push it out to 50 machines or more. command line freaks will love it.
learn more at radmind.org
Who exactly is your target audience? People who've never seen UNIX, people who've worked on UNIX environment for years? What is it you are attempting to accomplish with them?
Most of my list would be boring to people who know a lot about UNIX, however some of them are Linux specific.
Plagiarism isn't cool. the original post
"more", in its "standard" *NIX form, is forward-scroll only, among many other limitations. "less" takes care of all those limitations. Think if it as "less" is "vi" and "more" is "ex" (or "edlin", from the DOS days if you're unfamiliar with ancient tools).
Webmin's all well and good for a few machines. But if you're employed maintaining 100s of machines, there are very few real and free options, and I don't personally think webmin is one of them, unless it's become much more scriptable than when I last checked.
o n-fist's work, yet _can_ have role-based limited admin abilities.
cfengine works really well, but you don't appreciate its features until you hit the 70+ machine mark - the "trick" is that cfengine with it's inheritance and boolean class logic excels for systems that are different but have bits in common. Such different bits ALWAYS turn up with 70+ machines, simply because PC-class hardware's failure rate means something will have been changed on some machine somewhere at any given time. But if you've only got tens of machines runnning one OS rather than hundreds running five different OSes, it all seems like very hard work to set up your cfengine configuration files. The other "trick" is that cfengine is mostly multiuser and you can allow different users perform different actions, so when you've got a team of admins of different ability,
johnny-adds-visitor-laptops-to-vlan-17 just can't fuck up mordred-rules-production-database-servers-with-ir
- vi bindings work like tcsh
- preexec function that allows me to update xterm title bars before the command runs in them
- multiple output redirection (e.g. date > out1 > out2)
On the other hand, I much prefer bash for writing shell scripts because it has many features that make it a better tool for that job:- supports TCP and UDP filehandles (e.g.
/dev/tcp/localhost/80)
- nice array variables
- installed on just about every linux system
YMMVXJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-U
UN*X/Linux doesn't work that way. You are looking for a one size fits all administrative interface and it doesn't exist.
/etc. You can use this to write program to update different pieces as needed. Any problem you do, you can undo. You can then run a program or use "kill -HUP" to get a process to reread that configuration.
But I can sum up some the key points and bits of wisdom I have picked up over the years.
1) Ascii text is your friend. 98% of all the configuration files for UN*X programs live in ascii files and they "usually" live in
2) Pick a programming language. Perl, AWK, Sed, ksh, all of them. You can use that programming language to role out changes as needed, or make a lot of changes really quickly. RSH/SSH allows you to do that across multiple systems. Use it carefully!
3) Design your environment. If you know what you are going to be using the servers, workstations and/or Linux embedded appliances for you can better decide how to automate it.
4)"Crunchy Cookie, Liquid Center".
In the end you will be automating certain administrative tasks over and over, but not all of them. That's why one size fits all won't work. It becomes a bloated security hole, so you only automate what you need and you automate it in an original and secure fashion.
As for some rock solid TLA recommendations.
SSH - SSH is your friend and as a replacement for RSH and its ilk you can use it to securely automate tasks. read up on ssh-agent for automating ssh access across multiple machines.
mon - How do you know it's working if you don't test it? You need to turn on monitoring, the more specific the test and monitor the better. mon is a good PERL framework for performing any test, and it has a lot of prepackaged/contributed test scripts that come in handy.
LDAP - Lots of UN*X environments are moving to LDAP to store enterprise wide information. It depends on how big of a UN*X environment you are setting up but having a centralized directory ala LDAP can be quite handy.
PAM/NIS - Plug In Authentication Modules. You can use these to have a centralized authentication server, cuts down on password updates. NIS+ is a tried and true system for stitching UNIX Systems together but I've only seen it installed in 1 UN*X environment and I've worked in several.
If you are looking for a prebuilt system or paradigm like Microsoft Server then you need to look to Redhat, Debian, else you are going to work from the need/application outwards.
Whatever you do more than once you will automate. When you no longer can budget the amount of UN*X Admins you will need you will start to build "tools" to delegate routine tasks, these will eventually become web pages, the web page will become an application. The application will become an acronym. The acronym will become a skill. The skill will become a job requirement HR will use to backfill a position. That's the way it goes.
Enjoy!
"Don't fear death... fear not living..." -me
1) programable tab completion - yes folks there is more to tab completion besides beeping all the time. When I hit cd fooTAB the list of completions only shows _directories_ beginning with foo
...
... unzip, which will only complete filenames ending with ".zip"
... kill, will give you a full list of PID's to kill.
... killall, will complete process names.
... ping, telnet, ftp, will complete to entries in /etc/hosts
... insmod, will complete module names to be loaded.
... rmmod, will complete to loaded modules to unload.
"Bash" also supports programmable tab completion - it's possible to do stuff such as:
Tab completion after the command
And my favorite:
apt-get install, which will complete to packages known to apt
There are lots more of them, and of course, since it's programmable, more can be added to suite ones needs.
and the console spits out junk until you close that shell.
Just so you know, when you accidentally cat a binary file and it changes all the letters in your console to garbage characters, just blindly type
reset
and hit Enter. Fixes it every time.
Intelligent Life on Earth
I regularly access dozens of *nix systems (mostly linux & solaris). I love the fact that I can enter my privatekey password once on booting my laptop, and then have a tool handle all the ssh-agents in subsequent sessions. Entering one (very long and tangled :) password once is so much nicer than having to enter passwords every time I connect to a new system...
http://www.gentoo.org/proj/en/keychain.xml
Also, (obligatory) perl is great and larry wall is my hero...
If you look at Mandrake, there's tons of great config tools there:
diskdrake for disk partitioning
harddrake for hardware configuration
userdrake for user configging (or userconf)
XFdrake for X config
mousedrake for mouse config
printerdrake absolutely rules for CUPS, better than localhost:631 if you ask me
drakconf for ALL mandrake tools together
rpmdrake is good for package managing...
Oh and of course linuxconf is still nice! netconf is the network partition of that I think. The list goes on i bet
Berto
10 characters??? Seiously, pasphrases should be longer. But I wasn't writing this post to flame the length of your pasphrase. I wanted to add to this by saying that keychain will save you from having to repreatedly enter your passphrase. It's a front end to ssh-agent that allows you to enter your passphrase once and have it available system wide. Normally you have to enter your passphrase for every login session. Most distributions include keychain. For a good how-to see this page.
KDE's Print Manager. I've struggled for hours and hours trying to get my printer to work using the instructions from linuxprinting.org as well as CUPS documentation. I'm sure foomatic automates a LOT of stuff you'd have to do manually, but it still was falling pretty short. Such as the margins adjustment step and trying to set the hardware clipping plane... Even after I sit around with a ruler and doublecheck exactly which arrows on the page they're referring to, how do I enter stuff like "" or whatever? I tried at script's waiting prompt, and it just complained. After trying as many permutations of entering the data as I could think of, I finally gave up.
/dev/lp0? localhost? Just a comment for people to look at? It's probably in the documentation somewhere (if you even guess which piece of documentation you should look at for something simple like, say, USING the damn thing) but I must've just kept overlooking it.
And yes, I did try the web interface built-in to CUPS, but I would run into things like the "Location" blank. What's that?
"There's got to be a better way," I said to myself. Lo and behold, KDE Print Manager. Worked like a charm. Even informed me that "location" was an optional string of text for users. Sure, Print Manager isn't perfect, but then again, who is?
Slashdot: Failed Car Analogies. Amateur Lawyering. Anecdote Battles.
Nano also doesn't depend on any major packages. Pico is part of pine. And I don't want to install an entire email client that I will NEVER use (and have heard terrible things about) just to use a text editor. Nano works out of the box.
I've also heard nano is a smaller executable and runs much faster. I haven't really tested that, however.
Hypocrisy is the 8th deadly sin.
I think rm -rf / is right... [ra@gentoo ~] $ rm --help Usage: rm [OPTION]... FILE...
Yes, but rm FILE [OPTIONS] is much safer. Compare hitting enter to early when deleting a directory.
Man pages are generally unmaintained. Eg, man resolv.conf says the file is generally unnecessary as most machines have a DNS server installed on them.
Hi all. I prefer to answer the question as the best sysadmin tools that aren't always commonly used. Try:
l isa-paper_html/ for details (or, alternatively, use mine when I release it on the 'Net)d min.html
1. Go to www.infrastructures.org
2. Read each section, and select a tool which achieves the goal of the section
3. ???
4. Profit
The steps above will generate a good top 10 list.
Alternatively, you can use my list:
1. cfengine
2. Templating on cfengine config files (I use perl to template them); cfengine is better than anything else similar I've tried (although I haven't tried LCFG), but it still needs perl templating to make it work properly
3. Some kind of database; see http://astro.uchicago.edu/~davidr/cfengine-tools/
4. An ACAP server: http://infotrope.clues.ltd.uk/ (ok, I admit -- I've never set up an ACAP server, but they could become increasingly useful in the future, reducing support costs and the like)
5. Learn how not to be stupid about administration: http://users.sunet.com.au/~tsn/sysadmin/good_sysa
PS. Sorry about the anonymous posting, but this is a public terminal
Need a UNIX/Linux/network guru in the Boulde