The MAINFRAME
Planet Fox > Computer World > The MAINFRAME > Network File Services

Network File Services

This is actually the main reason I set out to build this thing. Sometimes I like to work on stuff out in the front yard, sometimes I'm working on stuff at my desktop, sometimes I like to work on stuff or need a file when I'm not even in town. That's where network file servers come in. There are two popular ways to share files, the Network File System and Server Message Block, the former being easy to setup on Unix and a pain to setup on Windows, the latter being easy to setup on Windows and a pain to setup on Unix. Since I have both, I decided to go with both.

Setting up Windows File Sharing

At this point I went ahead and loaded up the 120 or so GB of data I had on my desktop and notebook's hard discs to /home/server/FILE_SHARE via FTP. Since most of the computers I will be accessing this data from are Windows machines, I now had to setup Samba - a program which allows you to setup Windows style CIFS file shares on Unix. Since Samba comes with a great web-based configuration tool which isn't installed with the binary package, I went ahead and compiled it from the ports collection. Just be sure to select the "Enable SWAT" option in the configuration menu that pops up. Add the line samba_enable="YES" to /etc/rc.conf, then run service samba start

Swat listens on port 901, so to configure it just go to your server's address:901 in your web browser. Login as root. In my case I just needed to setup sharing of home driectories, which involves clicking on the GLOBALS tab, entering the workgroup, server string and NetBIOS name and changing Security to SERVER. Windows uses the NetBIOS name to locate the server, so type that into windows explorer to test it: \\ServerName\ShareName On a multi-interface machine, it's a good idea to set the interface variable on the Globals page to the IP and netmask of your internal network card (like 10.0.0.1/8), which prevents SMB requests being served to the internet. Block external access to ports 901 and 445 via firewall.

The first time you access the share it asks for a username and password. This is the same username and password you would use to login to the Unix machine under whatever account you want to use for that purpose, in my case, server. Click on "remember my credentials" and then map it to a drive letter - in Windows 7 you do that by going to Computer, clicking on "Map network drive" and then entering the path to your server, in my case \\MAINFRAME\server\FILE_SHARE

Setting up Unix File Sharing

The best way to share files among Unix machines is via NFS. This is super easy to setup since it's already built in.  Add the following lines to /etc/rc.conf

rpcbind_enable="YES"
nfs_server_enable="YES"
mountd_flags="-r"

 To setup the file system to be shared, edit /etc/exports. Here's mine:

/usr/home   -maproot=root   -network 10.0.0/8

Which exports the /usr/home filesystem to my local network. The client you're exporting the filesystem to needs to have the line nfs_client="YES" in it's rc.conf as well. The automatic mounter daemon amd can be configured to automatically mount available NFS shares, or you can just add it to /etc/fstab like any other file system like so

10.0.0.1/usr/home    /mainframe   nfs   rw,noauto    2   2

Since my Reven LXIV desktop is setup with Windows Services for Unix I can also access my files via NFS from it as well.

Powered by FreeBSD
Valid HTML 4.01
Site Map
©MMIX-MMXIV Planet Fox