“Quick HOWTO : Ch10 : Windows, Linux, and Samba/zh”的版本间的差异
来自Ubuntu中文
第39行: | 第39行: | ||
== '''启动Samba''' == | == '''启动Samba''' == | ||
− | |||
* 你可以采用chkconfig命令使Samba在系统启动时启动 | * 你可以采用chkconfig命令使Samba在系统启动时启动 | ||
− | + | <pre>[root@bigboy tmp]# chkconfig smb on</pre> | |
− | <pre>[root@bigboy tmp]# chkconfig smb on | + | * 你也可以在启动後运行如下的smb初始化脚本来启动/停止/重启动Samba |
− | </pre> | + | |
− | * | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<pre>[root@bigboy tmp]# service smb start | <pre>[root@bigboy tmp]# service smb start | ||
[root@bigboy tmp]# service smb stop | [root@bigboy tmp]# service smb stop | ||
− | [root@bigboy tmp]# service smb restart | + | [root@bigboy tmp]# service smb restart</pre> |
− | </pre> | + | <br>注意事项:和henduoinux软件不同的是,在修改Samba的配置文件後无需重启Samba,因为Samba当每次用户端请求时都读取配置文件。 |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | * 你可以使用pgrep命令来测试smb进程是否在运行,然後你将得到一个进程号 | ||
+ | <pre>[root@bigboy tmp]# pgrep smb</pre> | ||
− | |||
− | |||
− | |||
− | |||
== '''Samba配置文件''' == | == '''Samba配置文件''' == | ||
The /etc/samba/smb.conf file is the main configuration file you'll need to edit. It is split into five major sections, which Table 10-1 outlines: | The /etc/samba/smb.conf file is the main configuration file you'll need to edit. It is split into five major sections, which Table 10-1 outlines: |
2008年1月31日 (四) 18:17的版本
介绍
Samba是一个用来共享linux的资源(包括文件和打印机)给Windows的软件套装。本章介绍如何使Linux成为Windows主域名服务器(PDC)或者Windows工作组服务器。两种配置都允许用户:
- their own logins on all the home windows boxes while having their files on the Linux box appear to be located on a new Windows drive
- 使用linux上的共享打印机
- 访问linux用户组所共享的文件
域成员和工作组成员有什么区别呢,详细的描述超出本章的内容,但是这个简单的解释已经足够了:
- 一个域服务器把所有的登陆信息存储到自己的数据库上。这允许每个用户在网络的所有电脑上采用同样的用户名和密码登陆。
- 在Windows工作组中, 每台电脑都把用户名和密码存储在本地所以对于每台电脑用唯一的用户名和密码。
本章只包括最流行的域服务器设置方法。默认方式下,Samba几乎模拟Windows域服务器所有用来共享文件的方式。当你设置Samba时,linux本身的功能完全保留。Samba域和linux共享同样的用户名,所以你可以采用linux的密码来登陆基于samba的域并且立即获得你的linux用户的主目录下的权限。为了增加安全性,你可以为Samba和linux设置不同的密码。
Samba启动后每当有客户请求时,Samba的守护程序读取配置文件/etc/samba/smb.conf来决定不同的操作方式。你可以使用文本编辑器或者基于Web的SWAT软件来设置配置文件。使用SWAT设置相对简单些,但是如果你先用文本模式的编辑器创建/etc/samba/smb.conf接着再用SWAT来编辑配置文件,你用文本模式编辑器添加进配置文件中的所有注释都将丢失。下面介绍如何使用SWAT和文本模式编辑器来配置Samba。
注意事项:因为smb.conf文件经常的读写,你最好保存一份这个文件的拷贝以备不使用SWAT来时来设置此文件。当完成修改以后,使用第12章“Samba的安全性和调试”所述的testparm来验证修改的正确性。如果满意修改,把这个文件拷贝到原来的位置。
下载和安装
大多数RedHat和Fedora linux软件都是采用RPM格式的。下载和安装RPM软件包并不难,可以参考第6章"安装Linux软件"(那里涉及到具体的操作细节)
Samba由一系列的RPM软件包组成,可以在Fedora安装CD中找到。这些文件包括
- samba
- samba-common
- samba-client
- samba-swat
当你搜索这些文件的时候,记住这些RPM软件包的名字通常带有一系列的数字,比如samba-client-3.0.0-15.i386.
启动Samba
- 你可以采用chkconfig命令使Samba在系统启动时启动
[root@bigboy tmp]# chkconfig smb on
- 你也可以在启动後运行如下的smb初始化脚本来启动/停止/重启动Samba
[root@bigboy tmp]# service smb start [root@bigboy tmp]# service smb stop [root@bigboy tmp]# service smb restart
注意事项:和henduoinux软件不同的是,在修改Samba的配置文件後无需重启Samba,因为Samba当每次用户端请求时都读取配置文件。
- 你可以使用pgrep命令来测试smb进程是否在运行,然後你将得到一个进程号
[root@bigboy tmp]# pgrep smb
Samba配置文件
The /etc/samba/smb.conf file is the main configuration file you'll need to edit. It is split into five major sections, which Table 10-1 outlines: