Log in

Looking for Unix help... - John [entries|archive|friends|userinfo]

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Looking for Unix help... [Jun. 27th, 2007|09:54 am]
Okay... I'm out of work, and I need some stuff to study while I have some actual free time.

I've made my first obvious newbie mistake, and loaded Ubuntu server on my old desktop.

(Windows is the OS that has the bells and whistles and security holes baked into its servers; Unix uses minimal servers so that there are fewer security holes. In this case, I'm including "breakable things" as part of security.)

I knew better, really. I remember that there need be no difference between desktop and server Unix.

Anyway: I now have desktop Ubuntu running, and I've actually run a configure/make/make install on MySQL. Soon, I'll even verify that it works.... I'm going to dig into /etc/init* scripts (or directories) and inittab and try to figure my way through fstab and mnt.

I've gotten a tiny bit of right-feeling about the directory structure. I know to look for root-run binaries in /sbin, to look in /bin for certain binaries, and /usr/bin for certain other binaries. I learned /tmp and /var, and more. I successfully assimilated sudo and smirked when I realized I could sudo su; that last bit made me feel like the child-me picking a lock that protected the Oreos.

Next I need SSH and an SSH client so I don't have to use the awful KVM that I'm stuck with.

After that... well, does anyone have any pointers to some basic system and app monitoring and maintenance?

(Deleted comment)
[User Picture]From: wyang
2007-06-27 06:22 pm (UTC)

In the beginning, there was the word, and the word was... root?

When I look at what my machines do, they generally fall in a fairly small set of activities.

0) General system operation/administration/access

SSH, syslog/syslog-ng, sudo, shell access (I'm a tcsh fan, though bash works in a pinch), and PERL

1) Network support/firewall support/firewall

iptables, tftp, and syslog

2) File/print sharing and domain control

openLDAP, samba, cups

3) Relational databases

mysql, postgres

4) Web server

Apache, Squid (proxy)

5) E-mail

sendmail/qmail/postfix, courier-imap, procmail, spamassassin, clamav

6) Other network services

BIND (for DNS), NTP (for time service)

7) Esoterica for workstations

Xorg-X11, ALSA, mplayer, making a modem work, etc...

Outside of those areas, you're into custom apps or high maintenance/customization required apps.
(Reply) (Thread)
[User Picture]From: johnpalmer
2007-06-27 08:35 pm (UTC)

Re: In the beginning, there was the word, and the word was... root?

Thanks... I'm learning a bit about that xorg stuff already. SSH is trivial to install, but getting X working over SSH from Windows is clearly a tiny bit less trivial. (Hopefully by tomorrow, it'll be "trivial". Which, I'm sure you know, means "solved". Richard Feynman once stated that we math folks could only solve trivial problems because once a problem was solved, we called it "trivial".)
(Reply) (Parent) (Thread)
[User Picture]From: eleccham
2007-06-28 01:20 am (UTC)

Re: In the beginning, there was the word, and the word was... root?

I'll weigh in with my preferred instances of those things, where I feel I know enough to say so:

4) You might check out Privoxy. I run it instead of Squid now; just removing most of the BS speeds me up enough.

5) Postfix. Unless you're running a large/complex/etc. mail installation, don't bother with Sendmail. And qmail - at the risk of starting a flamewar - is more trouble than it's worth due partly to its supposedly better way of storing mail that's incompatible with three-quarters of the world. (And people I'd trust have explained to me why it's not really better; I just don't remember.)

For virus scanning mail, you might check out Avira as well; they have a virus scanner for Linux that does a great job that's free for non-commercial use. (It's what I run on my Windows boxes too.)

I also use CRM114 for spamfiltering.
(Reply) (Parent) (Thread)
[User Picture]From: eleccham
2007-06-28 01:21 am (UTC)

Re: In the beginning, there was the word, and the word was... root?

Oh... and this:

(Reply) (Parent) (Thread)
[User Picture]From: kightp
2007-06-29 01:22 am (UTC)

Re: In the beginning, there was the word, and the word was... root?


I know *just* enough about the subject at hand to (a) find that funny and (b) wonder whether the persons responsible grew up playing "Simon Says."
(Reply) (Parent) (Thread)
[User Picture]From: eleccham
2007-06-29 03:42 pm (UTC)

Re: In the beginning, there was the word, and the word was... root?

Did you see the alt-text? (Hold your mouse over the picture.)
(Reply) (Parent) (Thread)
[User Picture]From: kightp
2007-06-29 04:23 pm (UTC)

Re: In the beginning, there was the word, and the word was... root?

*hee* I always forget to do that...
(Reply) (Parent) (Thread)
[User Picture]From: eleccham
2007-06-29 04:26 pm (UTC)

Re: In the beginning, there was the word, and the word was... root?

That's sometimes the best part of xkcd.
(Reply) (Parent) (Thread)
[User Picture]From: thattallguy201
2007-07-04 08:54 pm (UTC)
Hey John --
Here's some of the logic that may be escaping you:
/bin and /sbin are typically part of the root filesystem, the filesystem that has to be mounted for pretty much anything to work. Therefore, the utilities in those directories are the minimal "get my system running" or "fix it please" type things. /usr, on the other hand, is a filesystem that typically is mounted after sanity checks and basic boot operations are completed, which means that the less-intrinsic functionality will be found there.

Basic monitoring -- most useful quickie text app is "top". That will show you in the first four or five lines how heavily loaded your system is, and the rest of the screen lists the running processes in order of their CPU utilization (the order is mutable.) A GUI tool (which can therefore be displayed over an X/SSH connection :) ) for recent-time monitoring is gkrellm, which I believe is *not* included in the standard distribution; you'll have to install it using the package manager. Gkrellm is a nicely configurable tool and gives you all the nice graphs-over-time that you'd expect.

The Swiss Army knife of monitoring is the tool "sar", sorry don't remember if it's installed by default but you can find it in the package manager if it isn't. Read the man pages for sar if you plan to use it -- sar flags are different on every OS.

Don't know if you have managed the "X over SSH" yet or not. It comes in three parts. (I believe you're using a Windows client to get to your Ubuntu machine, yes?)

1) First, you have to permit X communications over your SSH link. Most Windows SSH clients have a flag you can set to do that forwarding; for example PuTTY has a box that says "Enable X forwarding" or some such. Check the docs if you can't find it.

2) You need to be running an X server on your windows machine. I use Cygwin; it's free and it works fine. When it's running you'll see the X logo in your Windows system bar.

3) You're ready to start clients. You can start up any client you want on your remote machine with the DISPLAY environment variable set to your local machine's IP address followed by :0 and the UI pops up on your local machine. Use "DISPLAY=winIP:0 command" on the remote machine.

The "cool" way is to have a shortcut on your Windows machine that runs a local script containing
ssh -f uname@remote DISPLAY=winip:0 
-- which means you have no local window open at all, just a background SSH connection maintaining the link... and the remote window pops up on your Windows machine as though you had merged the desktops. :)

If you have any problems with any of this let me know...
(Reply) (Thread)