One of the common requirements in a Linux-based network is to include Linux workstations. There are a multitude of ways to do so; if this network also includes Windows workstations that are connecting to the Linux file server, you’re likely already using Samba. This document describes how to have a Linux workstation access data on a Linux file server via Samba. Here’s a quick tutorial to the essential steps involved in setting up a Linux File Server and having Linux workstations connect to it, using Fedora Core as an example.
Although I’ve already explained that this paper is covering the connection between a Linux workstation and a Linux server using Samba, some folks may be wondering about the choice. “After all, Samba is used for connecting Windows and Linux machines. It’s not necessary if you’re just connecting Linux machines.” This is true; there are ways, such as NFS, to accomplish this without Samba. However, this paper is based on the scenario that your network has Windows (and possibly Mac) machines as well, and thus the server already has Samba installed. In this situation, connecting Linux workstations to the server is relatively simple.
How file serving works on Linux
In Linux, the same general concepts apply. You create users and groups, assign users to groups, and then assign permissions to directories according to groups. The specific mechanisms work somewhat differently, of course.
On the server, you’ll use software called Samba that provides the functionality of serving files to users (much like Apache serves Web pages to users.) Samba allows a non-Windows server to communicate with Windows computers using the same networking protocol that is used by Windows computers. It can also be used by Linux workstations for the same purpose. You’ll create users (with the Linux adduser command), and groups that contain those users (with the Linux usermod command) – all on the server. Then you’ll create Samba users that correspond to the Linux users (with the Samba smbuser command). The third step is create Samba shares for specific directories on the server, via entries in the smb.conf file. For example, the /home/admin directory would have an entry in smb.conf that allows Samba to share it’s contents to other machines. Finally, you’ll assign users or groups to those Samba shares.
Then, on the client, you’ll create a mount point (roughly, the Linux equivalent of a mapped drive in Windows) by creating a new directory. Then you’ll assign the server’s Samba share to that mount point either by the ‘mount’ command (good for just the current session) or via an entry in the client’s /etc/fstab configuration file (which automatically makes the connection each time the machine is started up).
Download pdf The Ten Minute Guide to Setting Up a Linux File Server with Samba