Zit Seng's Homepage @ pobox.com/~lzs

Accessing NUSNET with Linux

This guide is for people who want to setup and configure their Linux system to access their NUSNET home directories and print to printers in SOC. These instructions are written for and tested on a Red Hat 7.1 system installed with Samba 2.0.10 (standard in Red Hat 7.1). It is likely that these examples will work just the same on Mandrake 8.0. As Linux distributions and software evolve rapidly and differ from version to version, you may have to modify the examples to cater to your specific configuration.

These instructions assume that you have:

Setting up Samba

Samba Configuration File

There are a few things you need to add to the Samba system-wide configuration file so that you don't have to keep specifying certain arguments every time you use the various Samba commands.

  1. Login as the root user.
  2. Open the file /etc/samba/smb.conf with your favourite editor.
  3. Under the [global] section, add/modify the workgroup variable to reflect your NUSNET domain (NUSSTF for staff, NUSSTU for students). E.g., workgroup = NUSSTF
  4. Set the server string variable to anything descriptive of your notebook. E.g., server string = Zit Seng's notebook
  5. Set your WINS server to either 137.132.1.60 or 137.132.1.63. E.g., wins server = 137.132.1.60 Make sure that the wins support variable is commented out.

Permissions of Samba Commands

If you want to connect and disconnect (known as mounting and unmounting in UNIX terminology) NUSNET directories while logged in as a normal user, you need to setuid to root the smbmnt (invoked by smbmount) and smbumount programs. This is because these commands work only when invoked with root privileges.

chmod 4755 /usr/bin/smbmnt
chmod 4755 /usr/bin/smbumount

It is always best to login to your computer as a normal user, and switch user to root only when you need to perform system administration tasks.

Setup Printer Queue

  1. Login as the root user and run printtool.
  2. Click New.
  3. Choose a queue name. Best to use the name of the printer. E.g., psmr
  4. Click on Queue Type on the left panel.
  5. For the Queue Type, choose Windows Printer (SMB Share).
  6. For the Share, type the Windows share name of the print queue. For staff users, this should be //NTS09/ followed by the printer name. For students, this should be //NTS27/ followed by the printer name. E.g., //NTS27/psmr.
  7. For the User and password, type your NUSNET userid and NUSNET password respectively. Notice that it is your NUSNET account that is required even though you are accessing SOC printers.
  8. For the Host IP, type 137.132.90.36 if you used NTS09 above, or 137.132.90.37 if you used NTS27 above.
  9. For the Workgroup, type NUSSTF if you are a staff or NUSSTU if you are a student.
  10. Click on Printer Driver on the left panel.
  11. Choose Postscript Printer.
  12. Click Driver Options on the left panel (under Printer Driver).
  13. Set the page size to A4.
  14. Click OK.
  15. At your option, select your new printer and click the Default button to set this printer as the default print destination.
  16. From the menu bar, click File, then click Save Changes.
  17. From the menu bar again, click File, then click Restart lpd.

Printing

You can now print using the standard UNIX print commands, optionally specifying the name of the print queue if you want to print to a printer other than the default. For example:

lpr -Ppsmr somefile.ps

Remember that you must send postscript content to the printers. If you have a plaintext file, you must use a program like a2ps to convert to postscript. This is no different from how you would print from any of SOC's central UNIX servers. On some Linux systems (such as Red Hat 7.1), there are 'magic filters' that help you convert from various file formats to postscript automatically so that, for example, you could send a GIF file to lpr and it will print correctly. Your mileage will vary; experiment on your system!

There is no way to check on the status of the actual print queue from your own system. In particular, a command like lpq -Ppsmr is only going to tell you the print status of the queue on your computer. Since you are printing to a remote print server, your print job will be delivered to the destination almost instantly and queued remotely.

Accessing Home Directories

Accessing or connecting to a NUSNET directory is the UNIX equivalent of mounting a directory. You can access the contents of your NUSNET home directory as if it were a directory in your computer.

You need to know the name of the network path to your NUSNET home directory. This is made up of two parts: the name of your home directory server, and the name of the share that contains your home directory. The server is NTS09 for all SOC staff and NTS27 for all SOC students. The share name is made up from the first few characters of your NUSNET userid. For taff, this would be the first 3 characters of your NUSNET userid. For students, this would be the first 4 characters of your NUSNET userid (e.g., iscp, isc1, isc9, etc).

To mount a directory, create the directory mount point and run smbmount //server/share mount-point -o username=nusnetuserid.

The following commands would be used by a SOC staff with the NUSNET userid comuser:

cd ~
mkdir nusnet
smbmount //NTS09/com nusnet -o username=comuser

The following commands would be used by a SOC student with NUSNET userid isc09999:

cd ~
> mkdir nusnet
smbmount //NTS27/isc09999 nusnet -o username=isc09999

You will be prompted for your NUSNET password. Your NUSNET home directory would then be found at ~/nusnet/nusnetuserid where nusnetuserid is your actual NUSNET userid. When you are done using this directory, unmount with these commands:

cd ~
smbumount nusnet

This is the general method for accessing any NUSNET and/or Windows share. For example, to access your SOC UNIX home directory, use these commands:

cd ~
mkdir unix
smbmount //stfsambahost/socuserid unix -o username=nusnetuserid

Substitute socuserid with your SOC UNIX userid and nusnetuserid with your NUSNET userid. Notice that both your SOC UNIX and NUSNET userid are required. You will be prompted for your NUSNET password. Your home directory will then be found at ~/unix. When you are done using this directory, unmount with these commands:

cd ~
smbumount unix
Copyright ©1997-2005 by Lai Zit Seng. All Rights Reserved. Get Firefox!