| The Smb page, for
a small example for the
Smb service. |
| For the average user,
there are two main Network
filesharing protocols nowdays. The NFS - Network Filesystem The SMB - Session Message Block NFS is classic in Unix and was developed by Sun Microsystems. SMB is Microsoft's File And Print Sharing. This page will give a small example for the second one. Paragraphs in this page are: A little theory A little practice Miscellaneus tasks A very interesting feature Ending A little theory. When a GNU/Linux or *BSD SMB server goes up, in reality two services start: The Smb that checks authentication and does the file and printer service and The Nmb that tunnels the Netbios host adressing protocol through TCP/IP. the daemons are called smbd & nmbd (the roles are obvious) It is recommended to start these servers as daemons, especially if the SMB service is continusly requested by the client hosts (but in general this is done automatically). The SMB server maintains an active list of all the shares that are available to the network and every shared directory - or printer - has also a share name and description.
This philosophy can produce very practical and easy to use networks, but in the other hand, it can be a dangerous hole. Considering security, obtaining the list of shares just by connecting to an SMB server isn't very secure, is it? So, if security is an issue, the SMB service must be brought up with full user authentication and protected from the wider network by a firewall. Both smbd & nmbd obtain their instructions by a configuration file: /etc/samba/smb.conf A little practice. Here is a small example with parts of my configuration file in host filer. To know more about my network, visit My System page.
Miscellanious tasks. Creating the shares in the server Since the mentioned shares belong to the main user of filer "micro", a directory /home/shared must be created by root (because micro can't do this) and then the ownership of this dir can easily be given to micro: su password: <type root password> mkdir /home/shared chown micro:users /home/shared logout Then micro can create all the directories that would be needed. All this can easily be done through telnet or ssh, if host filer is remote. Configuring the client The SMB clients don't have to be MS Windows exclusively. Read the /etc/fstab to get an idea of configuring such a client mount in a GNU/Linux or *BSD client, remembering that this configuration is done with security=share in the server side. Browsing the SMB servers The Samba package has a lot of useful utilities. One is findsmb, which searches for SMB servers inside the local network: findsmb *=DMB +=LMB IP ADDR NETBIOS NAME WORKGROUP/OS/VERSION --------------------------------------------------------------------- 192.168.0.1 ATHLON [MICROGROUP] [Unix] [Samba 3.0.4] 192.168.0.192 FILER +[MICROGROUP] [Unix] [Samba 2.2.8a] Another is smbclient, which does more than the example below: smbclient -L filer passwd: <in sequrity=share, password is just [Enter] > Sharename Type Comment --------- ---- ------- pub Disk Pub On Filer documents Disk Documents On Filer IPC$ IPC IPC Service (Filer On Samba Server 2.2.8a) ADMIN$ Disk IPC Service (Filer On Samba Server 2.2.8a) epson Printer Server Comment --------- ------- FILER Filer On Samba Server 2.2.8a Workgroup Master --------- ------- MICROGROUP FILER Mounting by hand in GNU/Linux or *BSD This task is easy: su password: mount -t smbfs -o passwd= //filer/pub /mnt/smb/filer/pub Including the mount in /etc/fstab Simply add a relevant line or more of this line example: //filer/documents /mnt/nfs/filer/documents smbfs passwd= The directories must be created before the mount. If no active nameserver is present in the LAN, filer has to be defined in /etc/hosts. We can also mount a directory from a Windows File and Print Server. A very interesting feature. A Samba server running in a Linux box can have a very interesting feature: If we include this: [homes] comment = Home Directories browseable = no writable = yes and we assign the main documents folder of all users in all all MSWindows clients to be: \\filer\micro where micro is the username which has to be changed to the appropriate one, then every user can access his/her own documents while in reality they are located in the central Linux server. But it would be preferable to set the Samba server's security to user. If the Windows clients are from NT and above (2000, Xp) and we create all users in all the clients, then they would access their own documents nomatter which Windows client they would log into! But for security reasons, all users plus administrators would have to be assigned with passwords. Ending. MS Windows hosts as clients or servers can be configured very easily. Explanations in this issue would exceed the role of my Linux pages. That's it, I wish you all happy filesharing. |