July 13, 2006

Accessing network resources in a mixed environment

Author: Anže Vidmar

The first thing that comes to most sysadmins' minds when they hear about file and print services in mixed Windows and Linux environments is probably Samba, but you can also make a rock-solid system for sharing resources via NFS on the *nix platform and DiskShare on Windows.

What's wrong with Samba? Nothing. I use DiskShare on Windows instead of Samba's SMB/CIFS sharing because I need a fileshare on Windows storage (SAN) to be accessible by Solaris clients, and unfortunately there is no SMB/CIFS support in the Solaris kernel yet. There is a Solaris application called Sharity that can mount SMB/CIFS shares on Solaris, but it didn't work well for me.

To make this work, we'll use NFS for all the sharing on all platforms. With NFS there is no problem sharing resources between Linux and other *nix systems. The problem is accessing resources on Windows shares from *nix clients, and vice versa. That's where DiskShare comes in.

DiskShare is an enterprise class Windows NFS server and gateway that allows Windows NT/2000/2003/XP-Pro workstations and servers to perform as NFS servers, so you can share files and printers among Unix workstations, PCs, and other NFS-based clients. It also integrates with Windows server security, mapping between *nix/Linux users and groups and Windows domain users and groups.

Installation and configuration

Download the trial version of DiskShare. Keep in mind that if you're going to map local *nix users with NT domain users, you'll need two copies of DiskShare -- one for the server where the shares are going to be, and the other on your Windows domain controller. The DiskShare application also works with Windows Clustering Services.

After you download the application, install it on a target server, and after the setup is complete, restart the computer. If you're going to map local users with NT domain users, install another copy of DiskShare on your domain controller(s), but this time choose the custom setup and install only the DiskShare Authentification component. When that's done, you're ready to configure some shares.

Run DiskShare Configuration from the application menu. Choose the sharing drive or folder in the Share Name field and select an NFS share name for it in the Alias field. You may leave the global permissions read-write as they are. That's all you need to do to create the first share. Repeat this step for all the shares you need.

The next step is mapping the local users with the NT domain users. First, copy the "passwd" and "group" files from the *nix server/client from which you want to have access to the share(s). Import the two files by using the Configure User/Group Mappings button of the Share Options tab. You can add additional users and groups in this configuration later by manually adding them through the same menu. It's also possible to replace the passwd or group file with an updated one later.

Now that you have imported users and groups, map them. Choose the local *nix user from the users list on the left side of window and the NT domain user that you wish to map to on the right side of window, then click the Add button. The mapped user will show in the NFS Mapped Users field. Do the same for the group mapping from the Group Mapping tab.
That's it; no need to restart any services. The shares are available right away. You can play around with more server and security options from the menu, but the defaults are good enough.

Test

To test the shares on the *nix server, run showmount -e hostname_of_win_server_running_diskshare. You should see the shares that are exported on a server similar to this:

# showmount -e kiwi.telco.local

Export list for kiwi.telco.local:
/disk1 (everyone)
/disk2 (everyone)
/disk3 (everyone)

This doesn't mean that all *nix users have read and write access on these shares; only those users who are configured with access through the "Sharing and security" menu on the server have rights.

Once you can see the shares, it's time to mount them:

mount -t nfs kiwi.telco.local:/disk1 /mnt/disk1

Also you can add a share's entry in the /etc/fstab folder to mount it at boot time. The entry should look like this:

kiwi.telco.local:/disk1 /mnt/disk1 nfs rw,bg,soft
kiwi.telco.local:/disk2 /mnt/disk2 nfs rw,bg,soft
kiwi.telco.local:/disk3 /mnt/disk3 nfs rw,bg,soft

If you administer a heterogeneous network and want to share resources between machines running different operating systems, you can use Samba or Microsoft Services for Unix to integrate NT and Unix environments, but you also have other alternatives. In addition to DiskShare, you can take advantage of NFS servers and clients from various vendors, including Omni-NFS Server from Xlink, opensource Allegro NFS Server, ProNFS by Labtam, and others.

Click Here!