File and Print Services for Microsoft® Windows® Clients (Samba)
来源:互联网 发布:扫地机器人算法 编辑:程序博客网 时间:2024/06/06 16:30
28.10. File and Print Services for Microsoft® Windows® Clients (Samba)
Samba is a popular open source software package that provides file and print services using the SMB/CIFS protocol. This protocol is built into Microsoft® Windows® systems. It can be added to non-Microsoft® Windows® systems by installing the Samba client libraries. The protocol allows clients to access shared data and printers. These shares can be mapped as a local disk drive and shared printers can be used as if they were local printers.
On FreeBSD, the Samba client libraries can be installed using the net/samba-smbclient port or package. The client provides the ability for a FreeBSD system to accessSMB/CIFS shares in a Microsoft® Windows® network.
A FreeBSD system can also be configured to act as a Samba server. This allows the administrator to create SMB/CIFS shares on the FreeBSD system which can be accessed by clients running Microsoft® Windows® or the Samba client libraries. In order to configure a Samba server on FreeBSD, the net/samba36 port or package must first be installed. The rest of this section provides an overview of how to configure a Samba server on FreeBSD.
28.10.1. Configuration
A default Samba configuration file is installed as /usr/local/share/examples/samba36/smb.conf.default
. This file must be copied to /usr/local/etc/smb.conf
and customized before Sambacan be used.
Runtime configuration information for Samba is found in smb.conf
, such as definitions of the printers and “file system shares” that will be shared with Windows® clients. The Samba package includes a web based tool called swat which provides a simple way for configuring smb.conf
.
28.10.1.1. Using the Samba Web Administration Tool (SWAT)
The Samba Web Administration Tool (SWAT) runs as a daemon from inetd. Therefore, inetd must be enabled as shown in Section 28.2, “The inetd Super-Server”. To enableswat, uncomment the following line in /etc/inetd.conf
:
swat stream tcp nowait/400 root /usr/local/sbin/swat swat
As explained in Example 28.1, “Reloading the inetd Configuration File”, the inetd configuration must be reloaded after this configuration file is changed.
Once swat has been enabled, use a web browser to connect to http://localhost:901
. At first login, enter the credentials for root
.
Once logged in, the main Samba configuration page and the system documentation will be available. Begin configuration by clicking on the tab. The section corresponds to the variables that are set in the [global]
section of /usr/local/etc/smb.conf
.
28.10.1.2. Global Settings
Whether swat is used or /usr/local/etc/smb.conf
is edited directly, the first directives encountered when configuring Samba are:
workgroup
The domain name or workgroup name for the computers that will be accessing this server.
netbios name
The NetBIOS name by which a Samba server is known. By default it is the same as the first component of the host's DNS name.
server string
The string that will be displayed in the output of
net view
and some other networking tools that seek to display descriptive text about the server.
28.10.1.3. Security Settings
Two of the most important settings in /usr/local/etc/smb.conf
are the security model and the backend password format for client users. The following directives control these options:
security
The two most common options are
security = share
andsecurity = user
. If the clients use usernames that are the same as their usernames on the FreeBSD machine, user level security should be used. This is the default security policy and it requires clients to first log on before they can access shared resources.In share level security, clients do not need to log onto the server with a valid username and password before attempting to connect to a shared resource. This was the default security model for older versions of Samba.
passdb backend
Samba has several different backend authentication models. Clients may be authenticated with LDAP, NIS+, an SQL database, or a modified password file. The default authentication method is
smbpasswd
, and that is all that will be covered here.
Assuming that the default smbpasswd
backend is used, /usr/local/etc/samba/smbpasswd
must be created to allow Samba to authenticate clients. To provide UNIX® user accounts access from Windows® clients, use the following command to add each required user to that file:
#
smbpasswd -a
username
Note:
The recommended backend is now tdbsam
. If this backend is selected, use the following command to add user accounts:
#
pdbedit -a -u
username
This section has only mentioned the most commonly used settings. Refer to the Official Samba HOWTO for additional information about the available configuration options.
28.10.2. Starting Samba
To enable Samba at boot time, add the following line to /etc/rc.conf
:
samba_enable="YES"
Alternately, its services can be started separately:
nmbd_enable="YES"
smbd_enable="YES"
To start Samba now:
#
service samba start
Starting SAMBA: removing stale tdbs :Starting nmbd.Starting smbd.
Samba consists of three separate daemons. Both the nmbd and smbd daemons are started by samba_enable
. If winbind name resolution services are enabled in smb.conf
, thewinbindd daemon is started as well.
Samba may be stopped at any time by typing:
#
service samba stop
Samba is a complex software suite with functionality that allows broad integration with Microsoft® Windows® networks. For more information about functionality beyond the basic configuration described here, refer to http://www.samba.org
.
- File and Print Services for Microsoft® Windows® Clients (Samba)
- SSH clients for windows
- CSS Reference Chart for SharePoint 2007 (Microsoft Office SharePoint Server 2007 and Windows SharePoint Services v3)
- SPL - Microsoft® Windows Spool File Format
- Designing Forms for Microsoft Office InfoPath and Forms Services 2007
- Introduction to Microsoft Windows Services for UNIX 3.5
- Install Microsoft Windows Services for UNIX 3.5 in Win2003
- Key Differences Between Thin Clients and Zero Clients for VDI
- Debugging Applications for Microsoft .NET and Microsoft Windows
- Effective Use of Microsoft Enterprise Library: Building Blocks for Creating Enterprise Applications and Services (Microsoft .Net
- Microsoft Windows Security Fundamentals: For Windows 2003 SP1 and R2
- Microsoft Windows SDK for Windows 7 and .NET Framework
- Windows PowerShell and Services
- Windows Services for UNIX
- Microsoft® SQL Server 2005 Notification Services
- sudo and samba file example
- Windows® API Code Pack for Microsoft® .NET Framework
- Lockless Programming Considerations for Xbox 360 and Microsoft Windows
- 文章关键词提取算法
- 插入排序二分排序冒泡排序
- Sicily 1530. The Seven Percent Solution
- 设计模式-桥接模式
- Git基本常用命令
- File and Print Services for Microsoft® Windows® Clients (Samba)
- if eles 问题
- 遍历map效率最高的方法
- 添加xib 子控件约束
- 个人总结3
- 004Median of Two Sorted Arrays (C)
- Git 解决Bug:fatal: Could not read from remote repository ——诺诺"涂鸦"记忆
- 设计模式-组合模式
- 3.大神班 scrollView 与 动画 imageView的加载图片