BSD DevCenter
oreilly.comSafari Books Online.Conferences.


Accessing Microsoft Files Using Sharity-Light
Pages: 1, 2

Once we've verified that the two computers can communicate with each other using TCP/IP, let's try to access the data in the files share of alpha:

cd /usr/local/sbin
./shlight //alpha/files /nt_1 -U administrator -P pass
Using port 4761 for NFS.

Let's see what happened here: shlight is the name of the Sharity Light executable. The UNC to the resource is //alpha/files; notice that Sharity-Light uses the double-slash in Unix-style convention, rather than Microsoft convention.

The -U is mandatory and is followed by a username that is valid on the NT computer; this user does not have to be recreated on the FreeBSD computer. The -P is also mandatory and must be followed by the password associated with that username.>/p>

Note that a port was opened by NFS to manage the connection. To verify the mountpoint:

Filesystem     1K-blocks  Used   Avail   Capacity Mounted on
shlight-10924  208592     62256  146336  30%      /nt_1

Now, let's try to access the data:

cd /nt_1

Regardless of whether the file system on alpha is VFAT or NTFS, we should be able to freely copy files back and forth between computers and make changes to files.

cp /etc/resolv.conf /nt_1
pico /nt_1/resolv.conf

Let's add a couple of nonsense lines I would never dream of putting in my real /etc/resolv.conf!!!

hello hello hello

and save the changes.

Walking over to alpha, I double-click on the files share and notice a new file called resolv.conf. I open up this file with Notepad and see the new lines I added from my FreeBSD computer.

When I'm finished accessing the files on the NT computer, I'll need to remember to unmount the share:

cd /usr/local/sbin
./unshlight /nt_1

Interesting things happen if I try to use Sharity-Light as a regular user. In FreeBSD, only root can mount filesystems. What if I'm a regular user who just happens to know the username and password for the administrative account on an NT computer? As a regular user:

cd /usr/local/sbin
./shlight //alpha/files /nt_1 -U administrator -P pass
Using port 1079 for NFS.
nfs mount /nt1: [1] Operation not permitted

The NT computer gave the OK for NFS to mount the share as the username and password were correct. However, NFS won't let a regular user mount a filesystem, so the user gets an error message instead.

Let's deal with some other common error messages when using Sharity-Light. This time as root:

cd /usr/local/sbin
./shlight //alpha/files /nt_1 -U adminstrator -P pass
error connecting to server: [13] Permission denied

This error message indicates an incorrect username or password. In this case, I've misspelled administrator.

./shlight //alpha/share /nt_1 -U administrator -P pass
error connecting to server: [5] Input/output error

This time I gave the incorrect sharename; there is no shared directory on alpha called share.

./shlight //beta/files /nt_1 -U administrator -P pass
beta: unknown host

Either there's no computer named beta, or I forgot to make an entry for it in my /etc/hosts file.

./shlight //alpha/files /nt -U administrator -P pass
nfs mount /nt: [2] No such file or directory

This time I forgot to create a directory named /nt to use as the mountpoint.

One final point: Sharity-Light can be used to mount shared directories located on either FAT or NTFS filesystems located on Microsoft computers; it can also mount data CD-ROMs located on Microsoft computers. However, it can't be used to access printers cabled to Microsoft computers; you'll need the added functionality of Samba to accomplish that task.

Dru Lavigne is a network and systems administrator, IT instructor, author and international speaker. She has over a decade of experience administering and teaching Netware, Microsoft, Cisco, Checkpoint, SCO, Solaris, Linux, and BSD systems. A prolific author, she pens the popular FreeBSD Basics column for O'Reilly and is author of BSD Hacks and The Best of FreeBSD Basics.

Read more FreeBSD Basics columns.

Discuss this article in the Operating Systems Forum.

Return to the BSD DevCenter.


Sponsored by: