University Of Pretoria Computer Science Department

UP Internet Howto (Linux)

Introduction

The need has arrisen for greater ammounts of internet access (The department has previously "limited" us to about 20MB per month). IT has launched an student internet initiative, allowing all students 400MB per year. We are now able to make use of this internet bandwidth under Linux (I'm still looking for a way to make this work under Windows). You cannot incur cost as the system is pre-paid (You can get more than 400MB per year, but you will have to pay for it)

Novell logins

Courtesy of the IT department, each and every student now has a Novell login, along with some disk space, mainly for use as H: drives under Windows. The default password for each login, is your ID number. This can be changed by logging into any of the Windows workstations in the Informatorium (if you can't log in - go ask the informatorium staff for help). I will hopefully soon have some way available of changing your Novell password from linux. The Novell server is massiff and it's dns name is massiff.up.ac.za

Changing your password

I'm still looking into this, at this point in time there is no easy answer, other than you need to find a windows machine which authenticates against MASSIFF, log in, and change your password. If anybody is aware of any tools to change a Novell password from within Linux, it would be appreciated if you could mail me.

There is a password utility called nwpasswd, unfortunately it'll only work if the client and the Novell server is on the same subnet as it doesn't take the -A switch to give it a DNS name. I'll be checking the newer version as soon as I can get it to compile.

The cache1 proxy and how it authenticates you

For the purposes of student internet access, a new proxy server, called cache1.up.ac.za has been set up, and is already in use by myself and a few others. The proxy server authenticates you by taking your IP address (assigned via dhcp) and comparing that to a list of active logins on massiff. If a login for your IP is found, then the said bandwidth is credited against that account. In this way, if you authenticate against massiff, the IP from which you authenticated will automatically gain internet access if you set your proxy to cache1.up.ac.za. The port the proxy is running on is 8080.

ncpfs, what it is, and how to use it

Update (2009-02-11)

The linux in the informatorium labs have been updated to ask the user for his windows/novell password upon login. The user's windows home directory is then mounted to $HOME/windows_share. As a side effect you will also be able to access the internet using your internet credits linked to your student number. By default the proxy settings for iceweasel(firefox), Opera and Konqueror is set to cache1.up.ac.za. The new system will remember your windows password and auto authenticate the next time you login. If however you change your windows/novell password, you will have to input the new password the next time you login to linux, or through the "Windows share" Kmenu item. Hopefully this new system will minimise the difficulty of accessing your windows share and internet from linux. Unfortunately printing hasn't been implemented yet. Below follows how the old system worked. The same underlying tools are used in the new system.

Old system

ncpfs is a linux package that allows you to mount ncp file shares (ncp is the file sharing protocol used by Novell). For those running Gentoo systems, you can simply emerge ncpfs, for those running from source-based systems, or those who cannot find rpms or debs for their systems, the source is available from ftp://platan.vc.cvut.cz/pub/linux/ncpfs/latest.

In addition to the above package, you will also need some kernel support. Your kernel may already have the required support, to check whether this is the case, do a cat /proc/filesystems and look for ncpfs. If you cannot find this entry, try modprobe ncpfs. If this module can be found, you should be ok too. If neither of these work, you will have to recompile your kernel (I hope you are not running RedHat - my condolences), please read the section about compiling your kernel.

If you have the package installed, and you have the kernel support, the next step is to authenticate against massiff, and mount your "H drive". You cannot simply authenticate without mounting due to the layout of the UP network, and the infancy of the ncp tools (Hopefully sometime soon we will be able to change our passwords). you should be able to execute:

ncpmount -S MASSIFF -A massiff.up.ac.za -V data -U ${ncp_user}.students.mc.up /path/to/mount/point

And when you are done (or in the cases when the script below breaks):

ncpumount /path/to/mount/point

I've also written a small script to automate this, aptly called mount_win_h.sh, the script is listed later on. You use it by doing:

mount_win_h.sh

or

ncp_user=s12345678 mount_win_h.sh

if your username on your local machine is something other than s and your 8-digit student number. This will check for the existance of ~/windows_share, create it if it doesn't exist, mount your Novell share on that and sit and sleep until you hit ^C or it gets some other signal to kill it. Unfortunately this doesn't always play nice and if you simply close the terminal the script will be terminated without getting the opportunity to umount the share.

Consequences of forgetting to unmount

Should you forget to unmount your windows share, you will keep on being logged in, allowing people who log in on the machine after you, to surf on your account. This applies mainly to lab machines where other students also have access to the machines. Thus, I advice all students to make sure that the windows_share directory has been unmounted before logging out and leaving the lab. You can check the current active mounts by typing mount in a console/terminal.

Changing your proxy settings

This depends on your browser, I don't know how many different browsers are in use in the department, so if yours is not listed here, please mail me a short explanation and I'll be more than happy to add to the list.

Viewing your quota and other usage information

After you have mounted you windows share, you can view your internet usage stats and quota by going to http://cache1.up.ac.za/ib.php.

Compiling your kernel with NCP support

I cannot possibly give a complete guide here to compiling you kernel, if you are unfamiliar with compiling a Linux kernel, I suggest reading the kernel-howto that can be found here. This is a guide for the 2.4.x series kernel though, I seriously recommend using a 2.6.x series kernel, which in my opinion is a lot stabler than 2.4.x, there is not much difference in configuring, the steps basically become

make mrproper
make ??config
make
make install modules_install

Where ??config is one of oldconfig, menuconfig, xconfig, gconfig, defconfig, allmodconfig, allyesconfig or allnoconfig. You probably want to use either menuconfig or xconfig. If you are not sure about the options you require, please read the above link.

To configure NCP, find the option "NCP file system support" by going to:

  1. File Systems
  2. Network File Systems

Once you have selected "NCP file system support" to be either compiled into the kernel, or as a module, you will get some suboptions, most of these are simply cosmetic options, but I will try and explain each of them as shortly as possible below (I personally enable all of them):

mount_win_h.sh

#! /bin/bash

#
# Written by Jaco Kroon (jkroon@cs.up.ac.za)
#
# BUGS:  When killing the terminal it runs in it dies, whether I like it or not.
#

function terminate_script()
{
	echo "Unmounting your windows share"
	while ! ncpumount ~/windows_share
	do
		sleep 1
	done
	exit 0
}

[ ! -z "${ncp_user}" ] || ncp_user="${USER}"

[ -d ~/windows_share ] || mkdir ~/windows_share || exit 0

cat <<EOT
When prompted, please enter your *windows* password.
This script will not terminate until you either log out or hit ^C
to terminate it.  Terminating this script will automatically umount
your windows share so that other people cannot use your internet
bandwidth.
EOT

ncpmount -S MASSIFF -A massiff.up.ac.za -V data -U "${ncp_user}.students.mc.up" ~/windows_share || exit 0

cat <<EOT

Successfully mounted your windows share.  To get inet access you
must set your proxy to cache1.up.ac.za, the port is 8080.
EOT

trap terminate_script SIGKILL SIGINT SIGSTOP SIGQUIT

while true; do sleep 60; done

A word of thanks

I'd like to take this opportunity to thank the deparment of IT for this initiative - I think it is great. Also I'd like to thank Paul Schutte for all his help towards me in getting this to work under Linux.

Finding help

I foresee some problems with kernels not properly supporting NCP, or people having trouble compiling them. Also, there will probably be a few other hickups, if you have any problems, even if you sort them out yourself, please let me know so that I can adjust this guide accordingly.

Jaco Kroon
jkroon@cs.up.ac.za
techteam@cs.up.ac.za

Printer Friendly Version

Home

Programming:
C/C++
Java
Web Development
LaTeX
Assembler
Python
Ruby
Manuals
Linux
OpenGL
Corba

Howto's:
Index
Categories
Single List
Download (23MB)

System Administration

Other:
The jargon file
Rute User's guide

UP Specific:
Ubuntu FPT Repo (Linux)
Internet (Linux)
Securemote (Windows)
IT's Documentation