Configuring a Samba Server
The default configuration file ( To configure Samba using a graphical interface, use the Samba Server Configuration Tool. For command line configuration, skip to "Command Line Configuration".
The Samba Server Configuration Tool is a graphical interface for managing Samba shares, users, and basic server settings. It modifies the configuration files in the To use this application, you must be running the X Window System, have root privileges, and have the Samba Server Configuration Tool The Samba Server Configuration Tool does not display shared printers or the default stanza that allows users to view their own home directories on the Samba server. The first step in configuring a Samba server is to configure the basic settings for the server and a few security options. After starting the application, select Preferences > Server Settings from the pulldown menu. The Basic tab is displayed as shown in Figure 21.4, "Configuring Basic Server Settings".
Configuring Basic Server Settings On the Basic tab, specify which workgroup the computer should be in as well as a brief description of the computer. They correspond to the Configuring Security Server Settings The Security tab contains the following options:
The Kerberos Realm field must be supplied in all uppercase letters, such as Using a Samba server as a domain member in an ADS realm assumes proper configuration of Kerberos, including the The Encrypted Passwords option must be set to Yes if this is selected.
After clicking OK, the changes are written to the configuration file and the daemon is restarted; thus, the changes take effect immediately. The Samba Server Configuration Tool requires that an existing user account be active on the system acting as the Samba server before a Samba user can be added. The Samba user is associated with the existing user account.
Managing Samba Users To add a Samba user, select Preferences > Samba Users from the pulldown menu, and click the Add User button. In the Create New Samba User window select a Unix Username from the list of existing users on the local system.
If the user has a different username on a Windows machine and needs to log into the Samba server from the Windows machine, specify that Windows username in the Windows Username field. The Authentication Mode on the Security tab of the Server Settings preferences must be set to User for this option to work.
Also, configure a Samba Password for the Samba User and confirm it by typing it again. Even if you opt to use encrypted passwords for Samba, it is recommended that the Samba passwords for all users are different from their system passwords.
To edit an existing user, select the user from the list, and click Edit User. To delete an existing Samba user, select the user, and click the Delete User button. Deleting a Samba user does not delete the associated system user account.
The users are modified immediately after clicking the OK button. Samba uses To specify the Windows workgroup and a brief description of the Samba server, edit the following lines in your Replace To create a Samba share directory on your Linux system, add the following section to your The above example allows the users Encrypted passwords are enabled by default because it is more secure to do so. To create a user with an encrypted password, use the command /etc/samba/smb.conf
) allows users to view their home directories as a Samba share. It also shares all printers configured for the system as Samba shared printers. In other words, you can attach a printer to the system and print to it from the Windows machines on your network.
Graphical Configuration
/etc/samba/
directory. Any changes to these files not made using the application are preserved.
system-config-samba
RPM package installed. To start the Samba Server Configuration Tool from the desktop, go to the System (on the Panel) > Administration > Server Settings > Samba or type the command system-config-samba
at a shell prompt (for example, in an XTerm or a GNOME terminal).
Figure 21.3. Samba Server Configuration Tool
Configuring Server Settings
Figure 21.4. Configuring Basic Server Settings
workgroup
and server string
options in smb.conf
.
Figure 21.5. Configuring Security Server Settings
security
option. Select one of the following types of authentication.
net
utility, which is part of the samba-client
package. Refer to the net
man page for details. This option does not configure Samba to be an ADS Controller. Specify the realm of the Kerberos server in the Kerberos Realm field.EXAMPLE.COM
.
/etc/krb5.conf
file.
encrypted passwords
option. Refer to "Encrypted Passwords" for more information about encrypted Samba passwords.
guest account
option.Managing Samba Users
Figure 21.6. Managing Samba Users
Command Line Configuration
/etc/samba/smb.conf
as its configuration file. If you change this configuration file, the changes do not take effect until you restart the Samba daemon with the command service smb restart
.
smb.conf
file:
workgroup =
WORKGROUPNAME
server string = BRIEF COMMENT ABOUT SERVER
WORKGROUPNAME
with the name of the Windows workgroup to which this machine should belong. The BRIEF COMMENT ABOUT SERVER
is optional and is used as the Windows comment about the Samba system.
smb.conf
file (after modifying it to reflect your needs and your system):
[
sharename
]
comment = Insert a comment here
path = /home/share/
valid users = tfox carole
public = no
writable = yes
printable = no
create mask = 0765tfox
and carole
to read and write to the directory /home/share
, on the Samba server, from a Samba client.Encrypted Passwords
smbpasswd -a
.
<username>