Electrical and Information Engineering
The University of Sydney
spcr
spcr

Linux Short Guide

  
The Linux Operating System is a public domain, UNIX-like operating system which runs on PCs, and enables them to network with other more powerful UNIX computers. The networking environment provided by Linux and a couple of Sun SparcStation computers, allows us to provide users with access to advanced CAD and software development environments, the Internet, and other UNIX resources.

Identifying the Workstation You're On

Linux workstations within the teaching network generally have a small (orange) sticker next to their power switch, with the number "xxx" on it. This indicates that the workstation has an IP address of "129.78.99.xxx". You should quote this number to support staff in the event that the workstation appears to be malfunctioning.


Getting Help

The  main people involved in running the teaching network are  ITU staff located in  J13-412.  You may also contact Dhruba Roy in J13-417.

To report problems with the network, computers, and/or services, or to seek assistance on any computing related issue affecting your undergraduate studies, please send e-mail to helpdesk.

Booting the Linux Operating System

In the following, it is assumed that the PC you are about to use is not currently being used by someone else - please consider the rights of others, when using laboratory computing facilities.

The operating system which is to be run on a given laboratory PC is selected at power-up. If the PC you are about to run Linux on is powered up, but not running Linux, then you should power it down, shutting down gracefully as appropriate, and in accordance with the requirements stipulated for the operating system in question (see the appropriate section of this guide).

If the PC you want to use is already running Linux, and it is not currently being used by anyone else, it will be displaying the X-Display Manager ("xdm") log-in screen, and you should proceed to the sub-section on "Loggin-In to Linux".

If the PC you want to use is powered down, power it up - booting the Linux operating system from the "Boot Menu":

Select Linux using the {up}/{down} arrow keys; Boot Linux by depressing the {enter} key.

Logging-In to Linux

You are required to log-in to the Linux computing environment. Your "username" and initial password will be the same as those used in the MS-DOS environment.

The Linux environment provides you with a "home" directory in which you can store your work and other data. The same space limitations as described in section 9, apply to your "home" directory under Linux. Under normal circumstances, you control _all_ access (except for "super-user" access) to this area - you should do all you can to ensure that things stay this way. You may guard against exposing your data to unauthorised access by ensuring that you use a suitably robust password (see "Choosing a Good Password"), and by remembering to log-out (see "Logging-Out From Linux") at the end of your computing sessions.

To Log-in: at the Linux "xdm" (X Display Manager) log-in screen, type your "username" and "password" as follows:

username {enter}

password {enter}

You will now be logged-in to the Linux (workstation) environment.

Important: Your password should be changed immediately upon logging in to Linux for the first time (see "Logging-In to Linux for the First Time").

After logging-in, you will be presented with an initial desktop environment. The default desktop environment comprises the following components:

The "fvwm" ("X11R6" compatible) virtual windows manager, which provides you with a graphical user interface; A terminal window ("xterm") onto the local host (the PC), which provides you with a command-line interface to the local host; An "xclock" in the top right-hand corner of the screen.

Have a look at your ".xsession", ".cshrc", and ".login" start-up files, for clues on customising your initial desktop environment.

Logging-In to Linux for the First Time

If you are logging-in to Linux for the first time, it is important that you change your password from its initial, easily determined value, to a more suitable (and secure) one of your choosing. This is essential, if you are to protect your work from unauthorised access, and to assist us in providing a more secure computing environment. Read the following sub-section to get some hints on choosing a suitable password, then login as described above, and proceed to "Changing Your Linux Password".


Simson Garfinkel and Gene Spafford in their book "Practical Unix Security" (O'Reilly & Associates, Inc) have this to say about choosing a good password:

Good passwords are passwords that are difficult to guess.

In general, good passwords:

  • Have both uppercase and lowercase letters;
  • Have digits and/or punctuation characters as well as letters;
  • Are easy to remember, so they don't have to be written down;
  • Are seven or eight characters long;
  • Can be typed quickly, so somebody cannot follow what you type by looking over your shoulder.

It's easy to pick a good password. Here are some suggestions:

Take two short words and combine them with a special character or a number, like robot4my or eye-con.

Put together an acronym that's special to you, like Notfsw (None of this fancy stuff works) or AUpegc (All UNIX programmers eat green cheese).

(Of course, robot4my, eye-con, Notfsw, and AUpegc are now all bad passwords because they've been printed here.)

And, don't foget, if it's in some dictionary, it's not suitable for use as a password!

 

Changing Your Linux Password

Your password in the Linux environment is maintained by Sun's Network Information Services (NIS) running on our Sun computers. To change your password, you need to be logged-in to one of these computers ("diesel" or "comlab"). You may log-in to one of the Suns using the "rxterm" utility script as follows:

rxterm diesel {enter}, or

rxterm comlab {enter}

This causes an additional "xterm" window to appear on your current screen. The command-line available to you within this window is processed by the Sun SparcStation - within this window you are logged-in to that SparcStation. You should change your password by invoking the NIS "yppasswd" program on the command-line within the "xterm" on the SparcStation as in the following:

yppasswd {enter}

The "yppasswd" program will ask you to enter your current password. This is to establish that you are the authorised user of the account being used. Enter your current password:

old-password {enter}

And when asked by the program, enter your new password:

new-password {enter}

And, when asked to confirm it, re-enter your new password:

new-password {enter}

Assuming all has gone well, you have now successfully changed your Linux (and SunOS) password.

 

Using The Mouse

The "X11R6" graphical user interface provided by the "fvwm" virtual windows manager is a very powerful GUI environment. In particular, it supports 3-button mouses. The 2-button (IBM PC style) mouses found on our Linux workstations, emulate the operation of 3-button mouses as follows:

The left and right buttons of the 2-button mouse match those of the 3-button mouse; Simultaneous operation of both the left and right buttons of the 2-button mouse matches the middle button of the 3-button mouse.

Using the mouse you are able to: select; resize; iconify; drag; drop; activate; etc. the various objects and applications appearing on your desktop. You may find it useful to search out a good introductory text on using the X Windows System - you may find that you can use it straight away using your intuition. In any event you should find this environment fun to use.

Using "rxterm" to Log-In to diesel & comlab

To log-in to one of the Sun computers we recommend you use "rxterm" in preference to "rlogin" (see man rlogin). To log-in to either of the Sun computers, type:

rxterm comlab {enter}, Or

rxterm diesel {enter}

within your "xterm" on the local Linux host. This causes an additional "xterm" window to appear on your current screen. The command-line available to you within this new window is processed by the Sun SparcStation - within this window you are logged-in to that SparcStation.

One of the benefits of "rxterm" is that in addition to logging you in to the remote computer (eg. "comlab" or "diesel"), it also sets up your local and remote environments, so that you are able to run "X" applications ("clients") on the remote computer, with their output being produced on the display attatched to your workstation (local host) - the workstation is providing an X-windows server for client applications running on the remote computer(s).

Try typing: /usr/openwin/demo/xeyes &

within the remote "xterm", to see a demonstration of such an application (running in the background).

Doing Laboratory Experiments

At the time of writing, there are two laboratory experiments which utilise the resources of the UNIX computer network. What follows is a guide to getting you started in these experiments. You should direct any course related queries to the tutor and/or lecturer concerned.


Starting Magic

This application is run "locally" on each Linux workstation. To start "magic" on your Linux workstation, type:

magic -dX11 filename {enter}

within your "xterm" on the local Linux host. Refer to your notes on "magic" for more information.

 

Doing the Image Processing Laboratory Experiment

This experiment requires you to copy "template" files from some prescribed area, and to perform minor edits upon them during the course of the laboratory.

In order to do this laboratory, you will need to log-in to one of the Sun computers ("comlab" or "diesel"). Refer to the sub-section entitled "Using "rxterm" to Log-In to diesel & comlab" and log-in to one of these computers.

Note: "comlab" is owned by the Communications group, so you should probably log-in to "comlab" for this experiment.

Refer to the "Getting Hard Copy" sub-section for notes on producing print-outs of your graphical images.

Refer to your notes on the "Image Processing" experiment for any further information.

Getting Hard Copy

There are two,(2) main network printers available. These printers are located within the Digital Systems Laboratory (J13-424), and the Digital Communications Laboratory (J13-417). Each of these printers is Postscript compatible.

To print to the network printers, you should preferably be logged-in to "diesel" (or "comlab"). By default, text files are printed in a reduced font at 2 pages per A4 sheet. This action can be defeated using the "-l" option to the print ("lpr") command.

Note: In the following, it is assuming that you haved logged-in to one of the Sun computers.

To print a file (plain text or postscript), type:

lpr -Pprinter filename {enter}

Use: printer=dsps1 to specify the printer in the Digital Systems Laboratory; printer=dcps1 to specify the printer available within the Digital Communications Laboratory.

To print a UNIX text file at normal size, type:

lpr -l -Pprinter filename {enter}

To print MS-DOS generated files (lines ending in ^M), type:

lpr -f -Pprinter filename {enter}

Occasionally, the Linux filter rejects a text file because it gets confused by the contents of the file (Linux does not recognise the file as text - even though it actually is). If you suspect this is happening, issue the command:

file filename

within a Linux "xterm" (the Linux filter program uses this command also, when attempting to determine the type of file being processed). If the command indicates some file type other than text, then try putting a blank line at the start of the file, and test the resultant filetype by running the "file" command again.

Some MS-Windows programs also put a ^D character at the start of Postscript files. This confuses the Linux filter program also. In this case you should use the "-f" option to the "lpr" command.

If you are doing the "Image Processing" experiment, you may wish to produce hard copies of your graphs and images (Note that for performance reasons, you should specify the printer in the Digital Systems Laboratory when printing graphics and/or images):

To produce hard copies of graphs:

Use "xgraph" to produce a "postscript" file by selecting "hardcopy", and specifying "file" as the output device.

Then, type:

lpr -P dsps1 filename {enter}

To produce hard copies of images (by courtesy your fellow students) you need to perform a sequence of operations:

Use "xv" to "fire-up" (in the background) the image you wish to print:

xv image_file & {enter}

Use "xwd" to "dump" the X-windows image:

xwd -nobdrs -out xpr_infile

Click the left button of your mouse to select the image which is to be printed. Use "xpr" to convert the image to Postscript format:

xpr -device ps -output outfile.ps -gray 4 -portrait xpr_infile {enter}

Then print the image out using "lpr":

lpr -P dsps1 outfile.ps {enter}

And, clean up:

rm -f xpr_infile outfile.ps {enter}

Alternatively, you may prefer to run a script named "xvp" which is available on "diesel", and which incorporates the above commands (semi-automating the process):

Use "xv" as in the previous approach:

xv image_file & {enter}

Then start the "xvp" script:

xvp {enter}

Click the left button of your mouse to the image which is to be printed.

When the script terminates, "xpr_infile" produced by "xwd", and "outfile.ps" produced by "xpr" are deleted. This is done after "outfile.ps" is despatched to the print queue.

Please .... follow the example of this script - delete your postscript file(s) when you are done with them, this will conserve disk space (you can always re-produce them again later if required):

To conserve disk space remove un-necessary files:

rm -f filename (...filename) {enter}

 

Reading and Sending Electronic Mail

The domain name for the teaching network is "eelab.usyd.edu.au". Your e-mail address is therefore "username@eelab.usyd.edu.au".

You can read and send e-mail using "mail" or "pine" on the Linux workstation (not recommended) or within a Sun log-in onto one of the Sun computers. For a more intuitive interface (recommended), you can run "xmailtool" on "diesel", or "mailtool" on "comlab" from some remote "xterm" running on your X-Windows desktop.

To run "xmailtool" (on "diesel" only) for example, you would:

rxterm diesel {enter}

then, within the "xterm" on "diesel":

xmailtool -fn 10x20 -color & {enter}

Which runs the program in the background (and in colour) using a large font.

If you prefer to use "mailtool" on "comlab" don't specify the "-color" option:

rxterm comlab {enter}

then, within the "xterm" on "comlab":

mailtool -fn 10x20 & {enter}

The user interfaces of these mailers are quite intuitive to use. Why not try sending yourself a test e-mail message? Just click on "compose", address the message to yourself, type in some text, and click on "send" to despatch it. Click on "done", and the mailer iconifies onto your desktop. On arrival of the test message, your mailer issues a , and indicates that new mail has arrived by changing the form of its icon. Double-click on the mailer's icon, and you will be able to read the message. Under normal circumstances, after reading each message, you would decide whether or not to save the message (into your home directory - just click "save" in your mailer) before removing it from the system "spooling" area on "diesel" (click "delete" in your mailer).

Important: Please be sure to remove your mail from the system spooling area, whenever you read your mail. If you want to retain your e-mail, do so by saving it to your mail directory.

As was indicated earlier, we do not recommend you access your e-mail from the Linux workstation. The mail queues on Linux are cleared at 15 minute intervals, if you can't be sure that the workstation won't be shutdown in the next 15 minutes or so, you should send your e-mail from a Sun log-in.

 

Using Netscape to Browse the Web

The Linux workstations have the Netscape X-Windows Web browser installed. Netscape is configured to initially load the University of Sydney home page. You should find that other parameters specified in ".netscape-preferences" have been customised to reflect your personal details.

To start Netscape:

netscape & {enter}

Using "mtools" and "tar" to Read/Write to Floppy Diskette

If you wish to transfer files between your filespace on Linux, and the floppy disk drive, you may use "mcopy" (Microsoft copy - try "man mtools"), or "tar" (originally the tape archiver - try "man tar").

The "mcopy" command produces Microsoft compatible target files (ie. MS-DOS can read them). Be careful with wildcards on the MS-DOS side of the filespec - you need to enclose them in quotes to protect them from the UNIX shell. For example, you could transfer a group of MS-DOS source files as follows:

mcopy "a:\dir\filename.*" some_unix_directory {enter}

While, going the other way:

mcopy unix_directory/filename.* a:\directory {enter}

Quotes are not needed unless "/" is used in the MS-DOS part.

The "tar" command is a very powerful command, which produces an archive file on diskette (or a series of diskettes using the "-M" option). The archive file format is not supported by MS-DOS. You may use the "tar" command to copy entire directories. For example, let's suppose that you have two important directories in your home directory (eg. assignments, and reports) that you want to move to floppy diskette in order to make them more secure, you might use the following sequence of commands:

cd $HOME {enter}

tar cphvf /dev/fd0 assignments reports {enter}

rm -rf assignments reports {enter}

Where:

  • "/dev/fd0" specifies floppy drive zero (a:);
  • "c" means create;
  • "p" means preserve the filemode of files;
  • "h" means don't dump symbolic links (dump the files they point to);
  • "v" means be verbose;
  • "f" specifies that a file is to be used as the target (we are creating an archive here - when extracting an archive specified by "x", use of "f" would specify that the source is a file).

    And, to restore the directories, you would perform the following sequence of commands:

    cd $HOME {enter}

    tar xphvf /dev/fd0 {enter}

  • Using Other Applications

    Various other applications are available under Linux and/or within Sun log-ins on "comlab" or "diesel". These include:

    "ftp" (all), "telnet" (all), "xmosaic" ("diesel"), "xv" (all), "xmag" (all), "xman" ("linux"), "xeyes" (all), "xarchie" ("diesel"), ....

    Have a look at the "Applications" sub-menu available from the pull-down "Utilities" menu under "fvwm", you will find other applications such as:

    "xfig" a drawing program, "xspread" a spreadsheet, ....

    Accessing On-line Help

    You should explore the "xman" program which is available on the Linux "fvwm" desktop. This application is to X-Windows, what "man" is to a text based environment. It allows you to read the manual entries (the on-line documentation) for the various commands, utilities, file formats, etc which are used by Linux.

    Note: For on-line help for SunOS commands etc. you should run the "man" command within the remote "xterm" of one of the Sun computers. Also, be aware that operation of a given command may differ in the two environments.

    Start "xman" from "fvwm" on the Linux workstation as follows:

    Select Xman from the pull-down "Utilities" menu

    The "Manual Browser" icon appears on the desktop. To commence reading the manual:

    Activate Manual Page on the "Manual Browser" icon

    Note that you may open multiple manual pages - repeat the previous step to view additional pages.

    Logging-Out From Linux

    In order to guard against exposing your data to unauthorised access it is imperative that you remember to log-out at the end of your computing sessions. To log-out at the end of your sessions: 


    Close-down your applications

     Activate the application's pull-down menu by clicking the left mouse button on the top left-hand corner of its controlling window;

    Select {destroy} (using the left mouse button).

    Close-down the virtual windows manager ("fvwm"):

    Activate the "Utilities" pop-up menu by clicking the left mouse button while moving the mouse anywhere within the "root window" (the background area);

    Select {Exit Fvwm} (using the left mouse button). This logs you out. The display manager ("xdm") then presents the log-in screen for authentication of the next user wishing to log-in to the Linux environment.

    Shuting-Down Linux

    Like other complex operating systems environments (including OS/2 and Windows NT) Linux should be powered down gracefully. If you simply "pull the plug" and turn the power off, then the next time Linux boots, it will complain that its file system is corrupt. It will then attempt to recover from the situation, but may find that it is unable to do so, requesting that remedial action be taken by support staff.

    To shut-down the workstation when Linux is running:

    • Log out as described in the sub-section "Logging-Out From Linux";
    • Depress Control-R (^R) to close-down the ("xdm") display manager;
    • Depress Control-Alt-Delete to shut-down Linux.


    Linux will now shut-down gracefully, unmounting remote filesystems, and keeping its own filesystems intact.

    Les Catterall

     

     

    spcr
    Print Friendly VersionPrinter format
    spcr
    Email a FriendEmail to a friend
    spcr
    Large text
    spcr
    Default text
    spcr
    textsize
    spcr