About Samba


This section covers the packages you need to install to run Samba, sources of more information on Samba, and users and passwords under Samba.

Prerequisites

Install the following packages:

  • samba

  • samba-client

  • samba-common

  • system-config-samba (optional)

  • samba-swat (optional, but a good idea)

Run chkconfig to cause smb to start when the system enters multiuser mode:

# /sbin/chkconfig smb on


Start smb:

# /sbin/service smb start


If you want to use swat, modify /etc/xinetd.d/swat, as explained in "swat: Configures a Samba Server" on page 701, and restart xinetd:

# /sbin/service xinetd restart


More Information

Local


Samba/swat home page has links to local Samba documentation (page 701) Documentation /usr/share/doc/samba-*

Web


Samba www.samba.org (mailing lists, documentation, downloads, and more) CIFS www.samba.org/cifs

HOWTO


Unofficial Samba HOWTO hr.uoregon.edu/davidrl/samba.html Samba HOWTO Collection Point a browser at the following pathname on the local system (after replacing the * with the value, such as 3.0.21b, from the local filesystem): /usr/share/doc/samba-*/htmldocs/index.html

Notes

Firewall


The Samba server normally uses UDP ports 137 and 138 and TCP ports 139 and 445. If the Samba server system is running a firewall, you need to open these ports. Using the Red Hat graphical firewall tool (page 768), select Samba from the Trusted Services frame to open these ports. For more general information, see Chapter 25, which details iptables.

SELinux


When SELinux is set to use a targeted policy, Samba is protected by SELinux. You can disable this protection if necessary. For more information refer to "Setting the Targeted Policy with system-config-securitylevel" on page 402.

Share


Under Samba, an exported directory hierarchy is called a share.

Samba


The name Samba is derived from SMB (page 1055), the protocol that is the native method of file and printer sharing for Windows.

Samba Users, User Maps, and Passwords

For a Windows user to gain access to Samba services on a Linux system, the user must provide a Windows username and a Samba password. In some cases, Windows supplies the username and password for you. It is also possible to authenticate using other methods. For example, Samba can use LDAP (page 1040) or PAM (page 438) instead of the default password file. Refer to the Samba documentation for more information on authentication methods.

Usernames


The supplied username must be the same as a Linux username or must map to a Linux username. Samba keeps the username maps in /etc/samba/smbusers. Users with the same username on Linux and Samba do not need to appear in this file, but they still need a Samba password.

When you install Samba, smbusers has two entries:

$ cat /etc/samba/smbusers # Unix_name = SMB_name1 SMB_name2 ... root = administrator admin nobody = guest pcguest smbguest


The first entry maps the two Windows usernames (administrator and admin) to the Linux username root. The second entry maps three Windows usernames, including guest, to the Linux username nobody: When a Windows user attempts to log in on the Samba server as guest, Samba authenticates the Linux user named nobody.

Passwords


Samba uses Samba passwordsnot Linux passwordsto authenticate users. By default, Samba keeps passwords in /etc/samba/smbpasswd. As Samba is installed, authentication for root or nobody would fail because Samba is installed without passwords: The smbpasswd file does not exist.

Each of the configuration techniques described in this chapter allows you to add users to smbusers and passwords to smbpasswd. You can always use smbpasswd as discussed later in this section to add and change passwords in smbpasswd.

Note


When you attempt to connect from Windows to a Samba server, Windows presents your Windows username and password to Samba. If your Windows username is the same as or maps to your Linux username, and if your Windows and Samba passwords are the same, you do not have to enter a username or password to connect to the Samba server.

Example


You can add the following line to smbusers to map the Windows username sam to the Linux username sls:

sls = sam


You can add a password for sls to smbpasswd with the following command:

# smbpasswd -a sls New SMB password: Retype new SMB password: Added user sls.


Now when Sam uses the username sam to log in on the Samba server, Samba maps sam to sls and looks up sls in smbpasswd. Assuming Sam provides the correct password, he logs in on the Samba server as sls.




A Practical Guide to Red Hat Linux
A Practical Guide to Red HatВ® LinuxВ®: Fedoraв„ў Core and Red Hat Enterprise Linux (3rd Edition)
ISBN: 0132280272
EAN: 2147483647
Year: 2006
Pages: 383

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net