12.07.2015 Views

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

310CHAPTER 13Network File SharingConfiguring the Samba Server with the Command LineTo configure a <strong>Red</strong> <strong>Hat</strong> <strong>Enterprise</strong> <strong>Linux</strong> system as a Samba server, the samba RPM packagemust be installed.The configuration files for Samba are located in the /etc/samba/ directory with the mainconfiguration file being /etc/samba/smb.conf.The options in the [global] section of the file apply to all shares unless an individualshare section overrides the global option.In the [global] section of smb.conf, specify a workgroup and description for the server:workgroup=WORKGROUPserver string=DESCRIPTIONEven though access to a specific share directory is granted via a username and passwordcombination, access can also be restricted to all shares from the server by IP address. Togrant only certain systems from accessing the server, use the following option in the[global] section of smb.conf:hosts allow = where can be the hostnames, IP addresses, or IP address ranges. If hostnamesare used, the system must be able to resolve them to IP addresses. All acceptableformats can be listed with the command man 5 hosts_access. The hosts allow optioncan also be used in the individual share sections.TIPUse the command man smb.conf to view a complete list of the many configurationoptions for Samba.Adding Samba UsersSamba uses its own user database, including passwords. However, a system user with thesame username must exist before a corresponding Samba user can be added to the server.To add a Samba user, create a system user with the same username if it doesn’t alreadyexist, and then use the following command as root:smbpasswd -a This writes an encrypted password for the user to the /etc/samba/smbpasswd file. Bydefault, Samba encrypts passwords. The use of encrypted passwords does not need to beexplicitly included in the configuration file, but it can be set with the following line inthe [global] section:encrypted passwords = yes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!