If you are a user of a mixed technology network that comprises both IP and IPX protocols it is likely that at some time or another you have wanted to have your Linux machine access data stored on a Novell fileserver on your network. Novell have long offered an NFS server package for their fileservers that would allow this, but if you are a small site or have only a small number of people interested in doing this it is difficult to justify the cost of the commercial package.
Volker Lendecke <lendecke@namu01.gwdg.de>
has written a Linux
filesystem kernel module that supports a subset of the Novell NCP
that will allow you to mount Novell volumes into your Linux filesystem
without requiring any additional products for your fileserver.
Volker has called the package ncpfs and derived the necessary
information mainly from the book "Netzwerkprogrammierung in C" by
Manfred Hill and Ralf Zessin (further details of the book are contained within
the README file in the ncpfs package).
The software causes Linux to emulate a normal Novell workstation for file services. It also includes a small print utility that allows you to print to Novell print queues (This is documented in the Print Client section later). The ncpfs package will work with Novell fileservers of version 3.x and later, it will not work the Novell 2.x. The ncpfs client will also work with close Novell compatible products, but unfortunately some products that claim to be compatible aren't compatible enough. To use ncpfs with Novell 4.x fileservers, it is preferred to use the Novell server in bindery emulation mode. The NDS support is a very recent early beta addition to ncpfs and additionally its use may be prohibited in your country due to the inclusion of patented technology.
The latest ncpfs package was designed to be built against the version
1.2.13
kernel or kernels later than 1.3.71
(this includes 2.x.x).
If you not using a kernel in either of these categories then you will have
to upgrade your kernel. The
Kernel-HOWTO describes how to do this in
detail.
You can obtain the ncpfs package by anonymous ftp from Volker's home site at: ftp.gwdg.de or sunsite.unc.edu or mirror sites. The current version at the time of writing was:
ncpfs-2.0.11.tgz
or ncpfs-2.2.0.tgz
which adds the NDS support.
The first thing you
need to do is ensure that your kernel has been built with IPX support enabled.
In the 1.2.13
version kernel you need only ensure that you have
answered Y
to the question: 'The IPX protocol
' as
illustrated:
... ... Assume subnets are local (CONFIG_INET_SNARL) [y] Disable NAGLE algorithm (normally enabled) (CONFIG_TCP_NAGLE_OFF) [n] The IPX protocol (CONFIG_IPX) [n] y * * SCSI support ... ...You will also need to ensure that you include an appropriate driver for your Ethernet card. If you do not know how to do this then you should read the Ethernet-HOWTO.
You can then proceed to build your kernel. Make sure you remember to run lilo to install it when you have finished.
# cd /usr/src # tar xvfz ncpfs-2.0.11.tgz # cd ncpfs
If you intend to use kerneld to
autoload the ncpfs kernel module then you must uncomment the
line in the Makefile
that refers to: KERNELD
. If you
are unsure what this means then you should read the
Kernel-HOWTO to familiarise
yourself with kernel module configuration.
The software should compile cleanly with no other configuration necessary:
# make
After the make has completed you should find all of the tools
you need in the ncpfs/bin
directory. You can use:
# make install
to install the tools in Volkers choice of directories. If you are running
on an ELF based system then you will need to rerun `ldconfig -v'
to
ensure that the shared library is able to be found.
If you are compiling for a 1.2.*
kernel then you will find a file
called ncpfs.o
in the ncpfs/bin
directory after the
make has completed. This is the ncpfs kernel module.
You should copy this somewhere useful. On my debian system I have
copied it to the /lib/modules/1.2.13/fs
directory and added
ncpfs
to the /etc/modules
file so that it will be
automatically started at boot time. If you are using some other distribution
you should find where it keeps its modules and copy it there, or just copy it
to your /etc
directory. To load the modules manually you need to use
the command:
# insmod ncpfs.o
For the latest version of ncpfs you must use kernel 1.3.71
or newer, this includes the 2.0.*
kernels.
If you intend using a kernel that is version 1.3.71
or newer then the
ncpfs kernel code has been included in the standard kernel
distribution. You need only answer Y
to:
Networking options --->
...
...
<*> The IPX protocol
...
Filesystems --->
...
...
<*> NCP filesystem support (to mount NetWare volumes)
...
You will still need to follow the instructions for building for kernels
1.2.*
so that you can build the tools but there will not be a module
file for you to install.
There are two ways of configuring the IPX network software. You can manually configure all of your IPX network information or you can choose to let the software determine for itself some reasonable settings using the command:
# ipx_configure --auto_interface=on --auto_primary=on
This should be reasonable in most circumstances, but if it doesn't work for you then read the 'IPX tools' section above to configure your software manually. Problems have been noted using this on networks containing Windows '95 clients.
After your IPX network is configured you should be able to use the slist command to see a list of all of the Novell fileserver on your network:
# slistIf the slist command displays a message like:
ncp_connect: Invalid argument
then your kernel probably does not
support IPX. Check that you have actually booted off the appropriate kernel.
When you boot you should see messages about 'IPX
' and 'ncpfs
' in
the system startup messages. If the slist command does not list all
of your fileservers then you may need to use the manual network configuration
method.
If your IPX network software is working ok you should now be able to mount a Novell fileserver or volume into your Linux filesystem. The ncpmount command is used for this purpose and requires that you specify at least the following information:
There is an equivalent ncpumount command to unmount a mounted NCP filesystem. The NCP filesystems will be unmounted cleanly if you shutdown your machine normally, so you needn't worry about ncpumounting your filesystems manually before a halt or shutdown.
An example command to mount fileserver ACCT_FS01
, with a login id of
guest
with no password, under the /mnt/Accounts
directory
might look like the following:
# ncpmount -S ACCT_FS01 /mnt/Accounts -U guest -nNote the use of the
-n
option to indicate that no password is
required for the login. The same login specifying a password of secret
would look like:
# ncpmount -S ACCT_FS01 /mnt/Accounts -U guest -P secretIf you don't specify either the
-n
or the -P
options you
will be prompted for a password.
If the mount is successful you will find all the
volumes accessible to the userid used for login listed as directories under
the mount point. You should then also be able to traverse the directory
structure to find other files. You may alternatively use the -V
option
to mount a single volume.
NCP does not provide uid or gid ownership of files. All the files will have the permission and ownership assigned to the mount point directory restricted by trustee permissions on the Novell server. Bear this in mind when sharing mounts between Linux users.
If you have some
need to permanently have an ncp mount then you will want to configure the
commands above into your rc files so that they occur automatically
at boot time. If your distribution doesn't already provide some way of
configuring IPX like debian then I recommend you place them in your
/etc/rc.local
file if you have one. You might use something like:
#
# Start the ncp filesystem
/sbin/insmod /lib/modules/1.2.13/fs/ncpfs.o
# configure the IPX network
ipx_configure --auto_interface=on --auto_primary=on
# guest login to the Accounting fileserver
ncpmount -S ACCT_FS01 /mnt/Accounts -U guest -n
#
There is another means of configuring NCP mounts and that is by building
a $HOME/.nwclient
file. This file contains details of temporary
or user specific NCP mounts that would be performed regularly. It allows
you to store the details of mounts so that you can recreate them without
having to specify all of the detail each time.
Its format is quite straightforward:
# The first entry is the 'preferred server' entry and is
# used whenever you do not specify a server explicitly.
#
# User TERRY login to DOCS_FS01 fileserver with password 'password'
DOCS_FS01/TERRY password
#
# Guest login to the ACCT_FS01 fileserver with no password.
ACCT_FS01/GUEST -
To activate these mounts you could use:
$ ncpmount /home/terry/docs
to mount: DOCS_FS01 with a login of TERRY under the /home/terry/docs
directory. Note that this entry was chosen because no fileserver was
specified in the mount command. If the following command were used:
$ ncpmount -S ACCT_FS01 /home/terry/docs
then a GUEST login to ACCT_FS01 would be mounted there instead.
Note: for this mechanism to work the permissions of the
$HOME/.nwclient
file must be 0600
so you would
need to use the command:
$ chmod 0600 $HOME/.nwclient
If non-root users are to be allowed to use this mechanism then
the ncpmount command must be Set Userid Root, so you
would need to give it permissions:
# chmod 4755 ncpmount
a utility to send messages to Novell users is also included in the package, it is called nsend and is used as follows:
# nsend rod hello therewould send the message "hello there" to a logged in user "rod" on your "primary" fileserver (the first one appearing in your
.nwclient
file. You can specify another fileserver with the same syntax as for the
ncpmount command.