Linux System Information




Managing User Accounts -  The easiest way to manage user accounts is with the program, "control-panel" which needs to be invoked as superuser.  If you click on the accounts icon, it lets you adjust the various features of the account.

Handy facts     -      Each user's password is located in the file, /etc/passwd
                                  The shadow passwords are located in the file /etc/shadow
                                  Basic information on accounts is on p149 of "Running Linux"
                                  Watch out for group number and UID to ensure cross-system compatability.

Backing Up Bigbro- We use DLT tape type III and IV for our DLT4000 drive.
                                    To put in a tape, Lift up Handle. Push in Tape. Lower Handle.
                                    Note you may need to clean the tape occasionally using the tape cleaner.
                                    The address of the tape drive is SCSI 1:0:4:0 mounted on /dev/st0. This is marked on the drive.
                                    Backups are done using tar. There is a script in /usr/src/sbin/ to do different types of backup.
                                    "full-backup" will do a complete backup to tape. It writes reports to /var/log/backup/compare.full.$shortdate.out
                                    "diff-backup" only records those files editted since the last full backup.

Boot Disk -  Linux boots through lilo, which is installed on the boot sector of the hard-drive.  If the boot sector of the hard-drive is corrupt, you are in a lot of trouble.  However, you can copy your boot sector onto a floppy and boot off that.  So long as your kernel image is still valid, this way you'll boot legally.  To make a boot disk, you need to use the routine, mkbootdisk.  This should be done every time the kernel is upgraded or modified.

df  - List the free space on each mounted partition

du - Disk Usage - can report in a wide variety of formats the current disk usage.

Environment - env - prints out your current environment

FTP Information - FTP on bigbro is restricted. When another machine trys to ftp Bigbro, a super-daemon called inetd swings into action. inetd monitors all the ports on the list /etc/services. For example, a telnet request will go to port 23 gets services of type tcp. Inetd also looks to a file called /etc/inetd.conf which tells it how to respond to each request.

For example, the ftp line looks like,
ftp stream tcp nowait root /usr/sbin/tcpd in.ftpd -l

This says call the wrapper daemon tcpd to check the ftp request for evil weevils and also execute the program in.ftpd.
The program, /usr/sbin/tcpd gets its list of okay and bad ftp sites from /etc/hosts.allow and /etc/hosts.deny which tells it who to let in and how to respond. By modifying those two lists you decide who is allowed in and who isn't. August 2000

GREP - Grep allows you to search for occurances of strings in an output.  For example,

    ls | grep cat

will look for any file listings with cat in the title.

HOWTO - If you want to know how to do something, chances are someone else has done it already.  Go to,

        http:\\linuxdoc.org\HOWTO\

And you should be able to find what you are looking for.

HTML Password Protection - We use Apache password protection to restrict access to some parts of our web service. Information is available at,

(see comments in etc/httpd/conf/access.conf)
(see also http://www.apache.org/docs/misc/FAQ.html
  user-authentication http://www.apacheweek.com/features/userauth
  http://www.apache.org/docs/mod/core.html#allowoverride )

apache maintains a password file in /etc/httpd/users. To make a new user, you log in as su and type,
             htpasswd /etc/httpd/users new-user-name.
This lets you set the password for a new user.
To then give or restrict access to a given folder, you make a ".htaccess" file in that directory. The file looks like

AuthName "Your project name"
AuthType Basic
AuthUserFile /etc/httpd/users
require user user-name-1 user-name-2 ... .

Now when people try to access this folder, Apache will request a username and password from them.

 Message of the Day- The message of the day can be set by the "control-panel" command as su. Go to Config - policies.

Information - There is a lot of good information at /root/sysdocs. Currently there is ethernet-slowdown.sysdoc, samba-bugs_timestamp.sysdoc, http-password.sysdoc, samba.sysdoc, popper-eudora.sysdoc, sendmail-reconfigure.sysdoc, popper-install.sysdoc and suggestions.sysdoc.

Job Control - Linux, unlike NT, really is a multi-tasking work environment so you want to run multiple processes on it.

                First up, "top" is a handy way for seeing which processes are around.
                Next, there is the "kill" command which is handy for killing unwanted jobs.
                "ps aux" gives you all the jobs currently occurring.
                Finally, you may want to run jobs in the background. This can be done with,

You can start a job in the background, log out and come back later to get the results. Here's an example using matlab:

$ nohup matlab < input & # Run in the background.
The nohup command stands for "no hangup". Without the nohup your job would be killed when you log out or close the terminal window.
Matlab will take its commands from the file input instead of the keyboard and anything that would have been displayed on the screen will go to the file nohup.out. If you want the output to go to some file other than nohup.out you need to redirect the output and error output to a file like this:

$ nohup matlab < input > output 2>&1 &

If you want error messages in a separate file from other output you can do this:

$ nohup matlab < input > output 2> error &

NOTE: you will have to include instructions to save the results of your calculations in the input file. For example if you want to calculate a set of results and then graph them you will have to run your calculation in the background and save the results. Then later you can read the results in and graph them. You can't run a program which displays on the screen in the background and come back later to see the results.

This will work for any program which takes input from the keyboard and writes output to a file or to a terminal window on the screen. It will work with MathKernel (math) but not with Mathematica (mathematica).

Kernel Upgrade - Make sure you ask Adam. Also, remember that lots of things change when you upgrade so you want to make up a checklist of things to look for. All our packages are regularly downloaded by a cron job into,

/usr/local/redhat/6.2/i386

Go somewhere quiet.  Copy across all the bits of the kernel you think might be useful.  Read the help pages.  Make an incantation along the lines of,

        rpm -ivh kernel-2.2.16-3.i386.rpm  ;

Once you've made a new kernel, you need to get bigbro to figure out where it is.  The kernel location is stored in,

    /lilo.conf

so you just edit the appropriate lines to point to the new kernel.  You can have multiple kernels in lilo.conf so you want to point it to the new one, but hang onto the old one until you are sure the new one works properly.

There are also a few problems if you are using a SCSI system.  Look into the command, mkinitrd.

Finally, make a valid boot disk or else!

    September, 2000.

ls -  List files.  Fancy variants are
            ls -a : List all
            ls -l :  Lis long

Mounting a CD - First you need a mount point. This is an otherwise vacant stub. You can do this with,
mkdir /cat/dog/CD_Mount_Point
Then, to mount it, you must be su and type,
mount /dev/cdrom /cat/dog/CD_Mount_Point
When you are done you should unmount it using the "umount" command
 

Networking - There is lots of things to think about with networking.

Your net identity is set in a number of places.  A good way to get at it is through the control-panel.  This will let you set your IP and netmask.

ifconfig - Gives the current configuration of the network cards

\var\log\messages - A good source of information for current problems on the network.

\var\log\secure - Gives info about people logged in through secure channels.

ifdown etho and ifup eth0 - Brings the ethernet card up and down.

ping - Good for testing if your card is working.

/etc/hosts - This is the file with all the host name specified in it.  By editting it, you can go ping bigbro instead of ping 128.2534.36.10.

PINE - Pine is the standard mail package on Bigbro.  You can customize it a lot.  Here is Raphael's suggestion,

All of the modifications below are required if you want to be able to type latin letters with accents.  They are NOT necessary to read them under PINE unless you are using terraterm.

To Change Character Set in Pine

    Main Menu
    Setup
    Config
    Couple of Space Bars Unitl you come across Character set

    Once this option is selected, type ? for help
    The Default set is US-ASCII
    For Latin languages, set it to ISO-8859-1

    Pine will sense the format and display it appropriately.
    To modify bigbro if you are using CSHC, edit .cshrc to have,
        setenv LANG Fr_CA
        stty -istrip cs8

    If you are using Tera Term, go to the Setup, Font and set it courier or similar.

    Raphael , 20 September 2000

PING -  A handy little routine to let you test network connections.  It sends small messages to any IP address you specify and awaits a reply.

            eg.  ping 128.253.36.10 would send packets to bigbro.

PS AUX - The command, ps aux, gives a complete listing of all processes on the system.

Red Hat Package Manager - Our RedHat installation of Linux comes with a redhat package manager. This is a great idea because it makes installation of standard software packages pretty trivial. Adam has cron set up to download new packages whenever they appear on the RedHat site, so to install all you have to do is fire up the Package Manager. It's all a bit too cute. On Bigbro RPMs wind up in /usr/local/redhat/6.2.

            Doing a full-blooded upgrade.

                            rpm -Uvh something.rpm   ; U - is upgrade, v - is verbose, h - is to make hatch marks of progress.

            Alternatively, you may only want to upgrade the things that are out of date but currently installed.  This is,

                            rpm -Fvh something.rpm   ; F - is freshen.

            Finding out about a package,

                            rpm -qa  etc.

            Finding out about rpm options.

                           man rpm

            Hopefully an example is coming soon.  September 2000.

RPMs come from the website http://www.rpm/org.  You can subscribe to an email list that tells you of important changes in the rpms.  RPMs should be installed one by one.  There is also information in Chapter Nine of the Linux 5.2 Installation Guide.

SAMBA - SAMBA is an interfacing package that permits drive sharing between NT, Win98 and Linux. SAMBA has its own list of users that maps Unix user names to SMB names. To use samba you must have both a unix account and an NT or Win98 account. From the Windows side, you simply log in as the appropriate user, give the right password and you immediately can mount Linux drives. From the Linux side, drives on the NT are mounted using smbmount. A sample would be,
smbmount "//BIO5TH/People" /mnt/nt/people -o username=us,guest,ip-128.253.36.14,netbiosname=bigbro.

This mounts the N: people directory as /mnt/nt/people with the user, us.
For twiddling with SAMBA you may find handy that,
1. The Samba log is stored in /var/log/samba
2. You can talk directly to SAMBA through http://localhost:901/
3. When restarting bigbro you can fire up the SAMBA links with the script /usr/local/sbin/mount-samba.
4. Samba passwords can also be set using smbpasswd.
5. There is a SMB account on bigbro called us with password bilayer that has full read permission but no write permissions.

Software Liscences - Our software comes from,

Charles Edward Jessup at CCC.
cej4@cornell.edu
255 3016
215 CCC.

Our matlab liscence file is located at /usr/local/matlab5/etc/liscence.dat

Syslog - This daemon looks after all the data logging on a Linux system.  It's config file is located in /etc/syslog.conf and tells it where to send various messages.  This is a good place to check if you are chasing error messages.

System Log - The system log is located in /root/sysdocs.  It should be updated whenever anything is done to bigbro or a problem is noticed
 

TAR - When untarring a file you would usually use,
tar -xvf.
  When tarring a file you'd often use,
tar --create --file-tar_filename.tar *.
There are lots of recursive options, piping through gzip and so on. To learn more about tar there is a good html file named, tar.html.

Tracking IP Numbers - To find the name of an unknown IP (eg 123.231.31.13) just type,

nslookup 123.231.31.13

UNIX User Environment - The command, printenv, will tell you many of the settings in your user environment including your mail directory, search path, printer, home directory, shell type and other goodies.

U for Useful -

Handy Info Stash : xman : an X-windows version of man with /etc/fstab : stores the file system table

Login -         passwd : Allows you to set or change your password
                     smbpasswd : Sets password for samba.
                     shutdown : Secure way to shut down the system.
                     useradd : add a user to the system.
                     chgrp : Change the group a file belongs to
                     chown : change the ownership of a file

Piping input around : | : pipes output into next command
                                      > : pipes output into a file
                                     &> : pipes all output into file.
                                     2> : pipes error into a file

Shell Parameters     chsh : change your shell function echo
                                  $SHELL : tells you what your shell is
                                  .bashrc : shell setup file for bash.
                                  echo $PATH : lists search path set up.
                                  export PATH=$PATH:/weird/directory : resets PATH to include new.

Virus Protection - We do our virus protection through Symantec.

http://www.symantec.com/

You download the latest virus definitions, and then run the virus watch.

These are all located on C:

You can get a copy of Norton virus protection from,

http://www.cit.cornell.edu/software/licenses/nav.html

You need SideCar installed. May 2000.

Wall -    The command

    wall "This is a message"

will broadcast "This is a message" to all users on the system.  This feature is only available to the superuser.

Xterm -  There are many features that can be set on X-term to suit you.  You can find out about them all using man xterm and man X.  The man X command gives you the more fundamental features that you need.

        Setting Xterm size - xterm -geometry 100x30+0+0  gives you an xterm that is 100 characters by 30 characters for example.  I don't know the function of the last two numbers.  Go to man X and search for geometry to find out.

X-windows -  Under Redhat, your X-window environment is best tinkered with inside the X-windows environment.  However, you can muck around with it outside the X-environment.

               From the command line, you can run xf86config.  This will let you select monitors, mice and other goodies.  You may need to be su for some of this.  It edits a file in /etc/X11.
 
 

A New Random Task -