Saturday, 10 April 2010

How to set up a Samba file server to use with Windows clients

According to the Samba project web site, Samba is an open source/free software suite that provides seamless file and print services to SMB/CIFS clients. Unlike other implementations of the SMB/CIFS networking protocol (such as LM Server for HP-UX, LAN Server for OS/2, or VisionFS), Samba (along with its source code) is freely available (at no cost to the end user), and allows for interoperability between Linux/Unix servers and Windows/Unix/Linux clients.
For these reasons, Samba is the preferred solution for a file server in networks where different operating systems (other than Linux) coexist - the most common setup being the case of multiple Microsoft Windows clients accessing a Linux server where Samba is installed, which is the situation we are going to deal with in this article.
 
Please note that on the other hand, if our network consists of only Unix-based clients (such as Linux, AIX, or Solaris, to name a few examples), we can consider using NFS (although Samba is still an option in this case), which has greater reported speeds.
 

Installing Samba in Debian and CentOS/Redhat

Before we proceed with the installation, we can use our operating system's package management system to look for information about Samba:

On Debian:
# aptitude show samba
 
On CentOS:
# yum info samba
 
In the following screenshot we can see the output of 'aptitude show samba' ('yum info samba' yields similar results):




Now let's install Samba (the screenshot below corresponds to the installation on a Debian 7 [Wheezy] server):

On Debian:
# aptitude install samba
 
On CentOS:
# yum install samba 
 

Adding Users to Samba

For versions earlier than 4.x, a local Unix account is required for adding users to Samba:
# adduser -s /dev/null -m -d /home/<username> <username>














 

 
# SAMBA SHARE
[xmodulo]
path = /home/xmodulo
available = yes
valid users = xmodulo
read only = no
browseable = yes
public = yes
writeable = yes
 

  , Linux Sys Administrator 
He is a GNU/Linux sysadmin and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work.

No comments:

Post a Comment