CIS Docs

This page provides an index of resources available to our students and visitors.

Instructional Linux @HFCC

About This System

This system is specifically designed and configured for use by students and faculty in the CIS 129 (UNIX Shell Scripting) and CIS 229 (UNIX System Administration) courses. This system also supports instruction in CIS 122 (Web/Internet Technologies) and CIS 162 (Perl Programming).

This system was originally established running the RedHat 6.0 Distribution of Linux. The system has been upgraded from time to time, and currently runs the Debian GNU/Linux Release 4.0r3 Distribution.

This system now operates as a VMware Virtual Machine and shares hardware with other CIS Department servers running on shared hardware.

Please note that unencrypted terminal and file transfer sessions are no longer supported! The PuTTY secure shell client is available in the ACS labs, and is also recommended for accessing the system from off-campus Microsoft Windows-based systems. Remote Linux and Apple Mac OSX users may use the built-in ssh tools included with your operating system. All connections should be made using the secure shell protocol.

What is Linux?

Linux is a free Unix-type operating system originally created by a Finnish college student named Linus Torvalds with the assistance of developers around the world. Linux is an independent POSIX implementation and includes true multitasking, virtual memory, shared libraries, demand loading, proper memory management, TCP/IP networking, and other features consistent with Unix-type systems. Developed under the GNU General Public License, the source code for Linux is freely available to everyone.

CIS Linux HOWTO - 1 - Introduction

1. Introduction

Linux HOWTOs are documents which describe in detail a certain aspect of configuring or using Linux. This mini-HOWTO is designed to help users and instructors take full advantage of the Linux systems provided for instructional use at HFCC.

1.1 System Availability

The server at cis.hfcc.edu is designed for use by students enrolled in CIS 129 and CIS 229 Unix/Linux Courses, and is maintained by the Office of Administrative Data and Voice Communications at Henry Ford Community College. Additional servers maintained by instructors may also be available, but are beyond the scope of this HOWTO.

The system is available for use 24x7 with the exception of a small nightly backup window.

Support for this system may be obtained by contacting the HFCC Help Desk at extension 6345. Additional support information is available on the Computer Information Systems Web Site at http://cis.hfcc.edu/info/.

1.2 Available Features

The CIS Linux server has been loaded with a rich variety of features, based on the Debian GNU/Linux Distribution of Linux.

Here is a brief list of some of the packages available on cis.hfcc.edu. Most of the
descriptions are either verbatim or adapted from an rpm -qi packagename query.

NOTE: misuse of these services will be considered a violation of the
HFCC Acceptable Use Policy.

1.2.1 Shells

  • bash - Bash is a GNU project sh-compatible shell or command language interpreter. Bash (Bourne Again shell) incorporates useful features from the Korn shell (ksh) and the C shell (csh). Most sh scripts can be run by bash without modification.Bash offers several improvements over sh, including command line editing, unlimited size command history, job control, shell functions and aliases, indexed arrays of unlimited size and integer arithmetic in any base from two to 64. Bash is ultimately intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard.Bash is the default shell for most Linux distributions.
  • busybox - Busybox is a single binary which includes versions of a large number of system commands, including a shell. This package can be very useful for recovering from certain types of system failures, particularly those involving broken shared libraries.
  • ksh - The real, AT&T version of the Korn shell
  • pdksh -The pdksh package contains a public domain version of the Korn shell (ksh).The ksh shell is a command interpreter intended for both interactive and shell script use. Ksh's command language is a superset of the sh shell language.
  • tcsh - Tcsh is an enhanced but completely compatible version of csh, the Cshell. Tcsh is a command language interpreter which can be used both as an interactive login shell and as a shell script command processor. Tcsh includes a command line editor, programmable word completion, spelling correction, a history mechanism, job control and a C languagelike syntax.

Users can use the chsh command to change their default login shell.

1.2.2 Network Applications

1.2.2.1 Server Applications

  • apache - Apache is a powerful, full-featured, efficient and freely-available Web server. Apache is also the most popular Web server on the Internet.
  • uw-imapd - The uw-imapd package provides server daemons for both the IMAP (Internet Message Access Protocol) and POP (Post Office Protocol) mail access protocols. The POP protocol uses a "post office" machine to collect mail for users and allows users to download their mail to their local machine for reading. The IMAP protocol provides the functionality of POP, but allows a user to read mail on a remote machine without downloading it to their local machine.
  • sshd - OpenSSH is OpenBSD's SSH (Secure SHell) protocol implementation. SSH replaces rlogin and rsh, to provide secure encrypted communications between two untrusted hosts over an insecure network. X11 connections and arbitrary TCP/IP ports can also be forwarded over the secure channel. Public key authentication may be used for "passwordless" access to servers.

1.2.2.2 Client Applications

  • finger - Finger is a utility which allows users to see information about system users (login name, home directory, name, how long they've been logged in to the system, etc.).
  • ftp - The ftp package provides the standard UNIX command-line FTP client.FTP is the file transfer protocol, which is a widely used Internet protocol for transferring files and for archiving files.
  • cups - The cups package provides the basic system utility for managing printing services. cups manages print queues and sends print jobs remote printers. It can also be configured to send print jobs to local printers and accept print jobs from remote clients.
  • lynx - Lynx is a text-based Web browser. Lynx does not display any images, but it does support most other HTML tags. Lynx's advantage over graphical browsers is its speed: Lynx starts and exits quickly and swiftly displays Web pages. All of the pages on this site should be Lynx friendly!
  • mailx - The mailx package installs the /bin/mail program, which is used to sendquick email messages (i.e., without opening up a full-featured mail useragent). Mail is often used in shell scripts.
  • nc - The nc package contains Netcat (the program is actually nc), a simple utility for reading and writing data across network connections, using the TCP or UDP protocols. Netcat is intended to be a reliable back-end tool which can be used directly or easily driven by other programs and scripts. Netcat is also a feature-rich network debugging and exploration tool, since it can create many different connections and has many built-in capabilities. Netcat users are again reminded to keep their activities compliant with the HFCC Acceptable Use Policy.
  • pine - Pine is a very popular, easy to use, full-featured email user agent which includes a simple text editor called pico. Pine supports MIME extensions and can also be used to read news. Pine also supports IMAP, mail and MH style folders.
  • ssh - The Secure Shell Client allows encrypted communications between machines for remote login and file transfer.
  • wget - GNU Wget is a file retrieval utility which can use either the HTTP or FTP protocols. Wget features include the ability to work in the background while you're logged out, recursive retrieval of directories, file name wildcard matching, remote file timestamp storage and comparison, use of Rest with FTP servers and Range with HTTP servers to retrieve files over slow or unstable connections, support for Proxy servers, and configurability.
  • whois - The whois program is used to query Internet whois databases to find information about system users. The most common use is determining internet domain name registration.

1.2.3 Development Tools

A variety of development tools and languages are installed on this system. The following list may not be current or completely accurate.

  • egcs - This is the GNU C compiler.
  • egcs-c++ - This package adds C++ support to the GNU C compiler. It includes support for most of the current C++ specification, including templates and exception handling.
  • egcs-g77 - The egcs-g77 package provides support for compiling Fortran 77 programs with the GNU gcc compiler.
  • perl - Perl is a high-level programming language with roots in C, sed, awk and shell scripting. Perl is good at handling processes and files,and is especially good at handling text. Perl's hallmarks are practicality and efficiency. While it is used to do a lot of different things, Perl's most common applications (and what it excels at) are probably system administration utilities and web programming. A large proportion of the CGI scripts on the web are written in Perl.
  • python - Python is an interpreted, interactive, object-oriented programming language often compared to Tcl, Perl, Scheme or Java. Python includes modules, classes, exceptions, very high level dynamic data types and dynamic typing. Python supports interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk,Mac and MFC).
  • tcl - Tcl is a simple scripting language designed to be embedded into other applications. Tcl is designed to be used with Tk, a widget set, which is provided in the tk package. This package also includes tclsh, a simple example of a Tcl application.

The system contains additional programming tools such as make and patch, as well as a variety of debuggers.

1.2.4 System Daemons

  • atd - at and batch read commands from standard input or from a specified file. at allows you to specify that a command will be run at a particular time (now or a specified time in the future). batch will execute commands when the system load levels drop to a particular level. Both commands use /bin/sh to run the commands.
  • vixie-cron - The vixie-cron package contains the Vixie version of cron. Cron is a standard UNIX daemon that runs specified programs at scheduled times. Vixie cron adds better security and more powerful configuration options to the standard version of cron. Scheduling is performed by using the crontab command.

CIS Linux HOWTO - 2 - Getting Connected

2. Getting Connected for Terminal and File Transfer Sessions

Most (if not all) course work for CIS Unix classes is performed from a terminal session to the host. Due to certain security considerations, users are now required to connect using only secure protocols.

2.1 Terminal Sessions Using PuTTY

PuTTY is a free implementation of Telnet and SSH for Win32 platforms, along with an xterm terminal emulator. It is written and maintained primarily by Simon Tatham.

2.1.1 Starting PuTTY On-Campus

From the HFCC computer labs, you can connect to cis.hfcc.net using PuTTY. The PuTTY icon will be in your Windows Start Menu, but for easiest access, right click on your desktop and select New, then Shortcut, and build a shortcut to F:\Internet\PuTTY\putty.exe

2.1.2 Obtaining PuTTY

If you want to use PuTTY to connect to the cis server from Off-Campus, go to the PuTTY Home Page at http://www.chiark.greenend.org.uk/~sgtatham/putty/ and look for the Download PuTTY link.

2.1.3 PuTTY Connection Settings

The first time you open PuTTY, you should make a couple of quick changes and save them to your default settings, as follows:

  • Under Session, click SSH. (This should change the port to 22.)
  • Under Connection/SSH, click protocol version 2.
  • Go back to Session, click "Default Settings" and click Save.

You may also want to default the following settings:

  • Session / Host Name (set to cis.hfcc.edu)
  • Connection / Auto-login username
  • Window / Appearance / Font

2.2 File Transfer Sessions Using PuTTY

PuTTY contains two file transfer utilities, psftp and pscp, which can be used to transfer files over secure shell.

2.2.1 File Transfer Using psftp

The psftp utility works very much like a standard ftp client. Refer to the ftp man page or PuTTY documentation for more details.

2.2.1 File Transfer Using pscp

pscp is a command-line utility for transferring files to and from ssh servers. It works best when installed in a subdirectory referenced by your Windows PATH environment variable.

  • Transfer to CIS from Windows: pscp filename.txt cis.hfcc.edu:filename.ext
  • Transfer to Windows from CIS: pscp cis.hfcc.edu:filename.txt filename.ext

Refer to the PuTTY documentation for more details.

2.3 File Transfer Using Email

2.3.1 Emailing Files to the Server

Since the CIS Linux server supports email, it would be possible to email files to this system as attachments. Some of the available mail clients could then be used to save the attachments to disk.

2.3.2 Emailing Files From the Server

The uuencode utility provides a handy way of mailing files as attachments. Simply insert uuencode in a pipe, as shown in the examples below:

Example 1: Email a File

cat filename.ext|uuencode filename.ext|mailx -s "Some Subject" somebody&#64example.com

Example 2: Email Output from a Program

tar -czf - *|uuencode filename.tgz|mailx -s "Some Subject" somebody&#64example.com

2.4 Transferring Files Using HTTP

2.4.1 Transferring files to the server

It is possible to bring files to the server using HTTP clients such as lynx or wget. Due to security restrictions, users may not access most off-campus websites from the CIS server. However, users can access files in the h:\webpage folder of their ACS network home directory.

Example

wget http://acs.hfcc.edu/~username/filename.ext

2.4.2 Transferring file from the server

Files placed in each user's public_html folder can be accessed from the web. Setting up this folder is documented in other sections of this guide.

2.5 Terminal and File Transfer Sessions Using Other Clients

The use of other clients for ssh sessions is beyond the scope of this HOWTO.

CIS Linux HOWTO - 3 - Email

3. Getting Connected for E-Mail

The CIS Linux system has complete e-mail services, with the following restriction: the system cannot be used as a mail relay for remote clients.

3.1 Using Mail Locally

As noted in the Introduction, many different e-mail tools have been installed on this system.

3.1.1 mailx

The mailx package provides a simple interface for sending and reading mail. To read mail using mailx, simply type mail at the shell prompt.

To send a message using mail, type mail -s "Subject Goes Here" recipient at the prompt, where "recipient" is the e-mail address of the receiver. You will next see your cursor on a blank line. Type your message. To end your message, either type a . (period) on an empty line or press Ctrl-D on an empty line. You will next be prompted for cc: recipients. Press enter to send your message.

mailx is often used in shell scripts to send output via e-mail. For example, to have the amount of disk space e-mailed to you, type

df | mail -s "Output of df" myname

where myname is your login name. To run your own command, type the following:

myshellscript | mail -s "Output of my job" myname

where myshellscript is the script to run. To get a little more advanced, you can also handle where errors go. To ignore errors, type

myshellscript 2>/dev/null | mail -s "Output of my job" myname

To include errors, type

myshellscript 2>&1 | mail -s "Output of my job" myname

These last two examples are useful when running your job with at and cron. If you don't redirect your errors, at and cron will send an additional message containing them, if there are any.

3.1.2 pine

The Pine (Program for Internet News and Email) program from the University of Washington is a very popular program for handling news and e-mail. To run it, simply type pine and press enter. Pressing ? at Pine's main menu screen will display extensive documentation on using the program.

3.2 Using Mail Remotely

3.2.1 Forwarding Mail to Another System

If you want to forward all of your cis mail to another address, create a .forward file in your home directory. The easiest way to do this is to type

cat > .forward

from a shell prompt in your home directory. Type the forwarding address and press enter, then press Ctrl+D and then Enter again. To have your mail forwarded to an ISP and delivered locally, put both addresses in the file, for example:

cat > .forward
username
username@example.com
(press Ctrl-D)

3.2.2 Handling Incoming Mail with procmail

You can also create rules for handling mail with procmail. Configuration of procmail is beyond the scope of this document. See the procmail documentation for details.

CIS Linux HOWTO - 4 - Web Publishing

4. Web Publishing

Users may publish pages on the cis.hfcc.edu web server.

4.1 Simple Web Page Creation

To create a web page, first create a directory named public_html in your home directory,
then create the file index.html, for example:

mylogin@cis:~$ mkdir public_html
mylogin@cis:~$ cat > public_html/index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<title>My Home Page</title>
</head>
<body>
<h1>This is my home page!</h1>
<p>Do you like it?</p>
</body>
</html>
(press Ctrl-D)
mylogin@cis:~$

This will create a (very) simple home page, which you can view at http://cis.hfcc.edu/~mylogin.

User home pages may be created locally using any text editor (vi, joe, etc.) or created remotely and published via ftp. Web Page development is beyond the scope of this article. HFCC offers courses in web design.

4.2 Forbidden Message on Web Page

You may find that when you try to browse to http://cis.hfcc.edu/~mylogin that you get a message like this one:


Forbidden
You don't have permission to access /~mylogin/ on this server.

If so, you will need to fix the permissions on your home directory. To do so, ssh to the server and log in. You will need to use the Unix chmod command to fix the permissions on your directory. For example:


mylogin@cis:~$ chmod o+x .
mylogin@cis:~$ chmod 755 public_html

Make sure that you do not give global write permissions to your home directory!

For more information, see the chmod man page.

CIS Linux HOWTO - 5 - Miscellaneous Topics

5.1 Changing Passwords

By default, the system will use an LDAP lookup to use your ACS Network (Novell) password for authentication. You may change your password on the Linux system, after which either password will allow you to authenticate.

To change your password, establish a shell session as defined in Section 2, then use the passwd command. The system is configured with a fairly stringent set of rules, and will not allow users to set a password deemed too easy to crack. See the passwd Man Page for more details.

5.2 Printing with lpr

To print from Linux, use the lpr command. There is no default printer configured for this system, so you must specify the printer name on the lpr command line.

  • To print a file, use this command: lpr -pprintername filename
  • To pipe the output of a command: somecommand | lpr -pprintername

See the lpr man page or the online documentation for more details.

5.2.1 Cups Printer Management

Printing is provided using the Common UNIX Printing System, also known as CUPS. On-campus users can view printer status and manage print jobs using the CUPS web interface at http://cis.hfcc.net:631/.

5.2.2 Configured Printers

The only printers currently configured are in rooms T194 and T199. The printer name for th printer in T199 is t199laser. The T194 printers are combined into a class with printer name of t194laser. To have printers configured in additional labs, please contact the Help Desk at x6345 or helpdesk@hfcc.net.