Docs/SysAdmin/Server/Samba

From Mandriva Community Wiki

Jump to: navigation, search
Samba: file and printer sharing using Windows SMB/CIFS protocol

Samba is used to access SMB/CIFS resources (used in Windows® networking), and provide file, print, and authentication services to Windows clients.

Note that there are a lot of fine manuals on configuring samba, this topic will really just focus on the easiest way of doing things, or in the case of multiple ways of doing things, the method most familiar to the authors of this page.

Contents

[edit] The Basics of getting Samba serving files on Mandriva Linux

[edit] Installing Samba

The very first thing you need to do is ensure Samba is installed. For general instructions on installing software on Mandriva Linux, see Installing and removing software. To access SMB/CIFS resources on other machines, you need to install the samba-client package. To make your machine act as an SMB/CIFS server, you need to install the samba-server package.

[edit] Configuring Samba

The first thing you need to decide on is how you are going to configure Samba. Use the method you prefer, and after this, we will refer to "configuring Samba to use xxxx", instead of telling you how to configure it.

The current suggested options are (in suggested order):

  • manually editing smb.conf - run 'vi /etc/samba/smb.conf' in one shell, and 'man smb.conf' on another - of course, you can use whichever text editor you like to edit smb.conf, and there are other ways to read the manual page.
  • the Mandriva Samba configuration tool - install the drakwizard package, run drakwizard as root, and select the 'Samba server' option.
  • webmin, the web-based general configuration tool. You must have installed the webmin package to use this.
  • SWAT - http://localhost:901. You must have installed the samba-swat package to use this.

If you are interested in learning about samba, manually editing the configuration file is really the suggested option. For people who just want to use it without becoming an expert, drakwizard is the best option. If you need to administer the server from a machine without an X server and you don't want to manually edit the configuration file over ssh, then webmin is preferred. SWAT is the last resort, since it removes all the comments from the default smb.conf file. Most of the configurations we will look at are already in there, and just need to be uncommented (but that's only possible for the manual edit option).

[edit] Before you configure yourself to death

Note that the default configuration will

  • Provide access to each user's home directory for them
  • Share all printers accessible by the printing system
  • Provide virtual printers which provide a PDF-creation facility for Windows users

However, there is something you need to do to get this working:

[edit] Adding Samba passwords for users

For a number of reasons, Windows password encryption is fundamentally incompatible with Unix password encryption, and although you can enable clear-text passwords (which works around this problem), in the long run it's more effort than allowing Samba to authenticate the Windows password.

So, for each user who:

  • has an account on your Samba server
  • logs into Windows with a username which matches the Unix account

you must add a Samba password.

For people editing smb.conf manually, run as root: smbpasswd -a.

Webmin and SWAT both have methods for dealing with this, and are easy enough to use that I won't cover them.

If your users log into Windows with a different username, access will be inconvenient from Windows, unless you configure a 'username map' file, which is beyond the current scope of this document.

Now, assuming you enter the same password they use in Windows, you should be able to access the samba server by its netbios name (which defaults to its hostname) or its IP address, as \\server or \\<IP address>.

The user should be authenticated, and should see a share with their username (ie \\server\user), if not, you may have got a problem somewhere.

[edit] Accessing Windows XP Shared Folders

It is important to remember that the host name for your system needs to be valid for Windows shares to be accessible. This can be set via the Mandriva Linux Control Center->Network->Internet Connection.

[edit] Other Links

Personal tools