Samba Manager

## This help page is incomplete

### Introduction

Samba is a freeware program that allows PC's running Windows 95 and NT to access files and printers on your Unix system, as though it is a Windows file/print server. Some Unix systems such as Redhat Linux include Samba as part of the standard installation, while most others require you to download and install it separately.

If you don't have Samba installed on your system, the module's main page will complain that it cannot find the Samba configuration file and you will be unable to share any files or directories. If you do have Samba installed but are getting this error message, check the module configuration to make sure that Webmin is looking in the right place for the configuration file and Samba programs.

Assuming Samba is installed properly, the module's main page will display a list of all the file and printer shares defined on your system. If Webmin determines that the Samba server is not running, you will be given the option of attempting to start the server. This may be necessary if Samba is not started at bootup time.

### Creating a File Share

A Samba file share is a directory that can be mounted by client PC's. Every share has a short name such as `docs` or `www`, which maps to some directory on your Unix system. A share is typically referred to by a client using the `\\server\share` notation.

To create a share, click on the `Create File Share` link below the list of existing shares on the main page. This will display a form allowing you to enter the details of the new share. Although Samba supports a large number of parameters for each share, the most important ones are:

Share Name | Every share must have a name, used by clients to refer to it. One special case is the `All home directories` share, explained later.
Path | The directory to be shared. Clients using this share can only access files in or below this directory.
Writable | Determines whether clients can write to files and directories in this share.
Guest access | If a share allows guest users, clients can access it without needing to provide a valid name and password. A share can either disallow guest users, allow guests and normal users, or allow guests only.

For information about other share options, see the Advanced Options section below.

Once you have entered the details of a new share and clicked the `Create` button, it will be immediately available to client PC's. Assuming everything is set up correctly on your network, users will be able to use the `Network Neighbourhood` function under Windows to see your server and all its shares. The newly created share can then be mapped to a drive letter on the PC.

### Creating a Printer Share

A Samba printer share is a local or remote Unix printer that you want to make available to PC clients. Like file shares, every printer share has a short name (like `hp5si`), and is referred to using the `\\server\share` notation.

To create a new printer share, click on the `Create Printer Share` like from the main page. This will display a form similar to the one used for creating file shares, in which you can enter the details of the new share. The most important options for a new printer share are :

Share Name | Every share must have a name, used by clients to refer to it. One special case is the `All printers` share, explained later.
Printer | The Unix printer to be shared. This can be any printer that you would print to using the `lpr` command.
Path | The directory in which temporary print files
Guest access | If a share allows guest users, clients can access it without needing to provide a valid name and password. A share can either disallow guest users, allow guests and normal users, or allow guests only.
Printer type | The name of the printer driver that should be used for this printer. If you enter a value for this option and it matches a printer drive on client PCs, then users will not have to choose a printer driver when adding this printer.

As with file shares, many more options are available for print shares. As soon as a printer share is added, it will be available to clients. Under Windows 95 and NT, a printer can be added using the `Add Printer` option in the printers control panel. Once added, the user can print to it like any local or network printer.

### Creating a Copy

### Editing a Share

To edit an existing share, click on its name from the list of shares on the main page. This will display the same form used for creating a share, allowing you to modify all options and parameters. To save your changes, click on the `Apply` button at the bottom-left of the page.

To delete a share, click on the `Delete` button at the bottom-right of the page. Existing users will not be immediately disconnected - however, no new users will be able to connect to the share.

### Users and Security

For shares that do not allow guest access, Samba expects the client to provide a username and password. Typically, these are checked against the Unix user list which can be updated by the User Manager module. Samba can also keep its own username and password list - see the Encrypted Passwords section for more details.

Some versions of Windows do not allow the user to provide a username when accessing a share - instead, the username provided when 'logging in' to Windows is used. If all client users login to Windows using the same username that they use for Unix, then this is not a problem. If not, you have 2 options:

1. Windows 95 and NT can mount a share manually, either by typing `net use drive: share` at the command prompt or by clicking the map network drive button in a file window and entering the share path. In both cases, the share can be in the format `\\server\share%user`, where user is the username to login to the server with.

2. Samba can be configured to attempt to match the password provided against a list of users, in order to find the correct username. The `Unix users` share option allows you to specify the users or groups of users to check against. Beware that using this option with a large number of users is not very secure, because 2 people may have the same password.

   ### Encrypted Passwords

   Normally, passwords sent over the network between a Samba server and PC clients are not encrypted. This is bad for 2 reasons :
   1. Anyone can listen in on your network and capture other people's passwords.
   2. The latest versions on Windows 9x and NT refuse to send passwords unencrypted. Users trying to access your Samba server from these systems will get an error message like `???`. This change first appeared in NT service pack 3.

   Fortunately, Samba can use encrypted passwords. However, it is not possible to match passwords sent by clients against the normal Unix password file because of the different forms of encryption used. For this reason, Samba must maintain its own list of users and passwords.

   To switch Samba into encrypted password mode, you must:

   1. Make sure your version of Samba supports password encryption. In the `Password Options` page, set the `Encrypted passwords` option to yes. If this fails, you will need to download or compile a version with encrypted password support.

   2. Click on the `Convert Unix users to Samba users` link at the bottom of the main page. This will take you to a page in which you can convert some or all of your existing Unix users to Samba users. Usernames, real names, UIDs and shells will be converted - but passwords will not.

   3. To assign passwords to users, use the `Edit Samba user list` option on the main page. This will display a list of all Samba users, from which you can choose a user to edit. The password for each user can either be `Locked` (no login allowed), `No Password` (no password needed) or some password that you enter.

      Return to module