1、从系统ISO镜像中找到samba安装文件:
samba-client-3.0.33-3.28.el5.i386.rpm
samba-common-3.0.33-3.28.el5.i386.rpm
samba-3.0.33-3.28.el5.i386.rpm
perl-Convert-ASN1-0.20-1.1.noarch.rpm (安装samba的时候需要被引用到)
2、依次安装:
rpm -ivh perl-Convert-ASN1-0.20-1.1.noarch.rpm
rpm -ivhsamba-common-3.0.33-3.28.el5.i386.rpm
rpm -ivh samba-3.0.33-3.28.el5.i386.rpm
rpm -ivh samba-client-3.0.33-3.28.el5.i386.rpm
3、查看是否已安装:
[root@localhost samba]# rpm -qa|grep samba
samba-3.0.33-3.28.el5
samba-common-3.0.33-3.28.el5
samba-client-3.0.33-3.28.el5 (已经成功安装了)
4、修改samba配置文件:
vi /etc/samba/smb.conf
修改如下:
workgroup = MYGROUP server string = Samba Server Version %v ; netbios name = MYSERVER ; interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24 192.168.1.1/24 ; hosts allow = 127. 192.168.12. 192.168.13. 192.168.1.
……
……
# ----------------------- Standalone Server Options ------------------------ # # Security can be set to user, share(deprecated) or server(deprecated) # # Backend to store user information in. New installations should # use either tdbsam or ldapsam. smbpasswd is available for backwards # compatibility. tdbsam requires no further configuration. security = share passdb backend = tdbsam
……
……
# A publicly accessible directory, but read only, except for people in # the "staff" group ; [public] ; comment = Public Stuff ; path = /usr/local/XXXXX ; public = yes ; writable = yes ; printable = no ; write list = +staff
最后新增("hxquan"就是windows下映射网络驱动器所需要的文件名):
# This is samba text [hxquan] comment = hxquan path = /usr/local/hxquan writable = yes public = yes
(也可以通过命令chcon -R -t samba_share_t /usr/local/XXXX共享一个文件夹)
5、重启samba服务:
[root@localhost samba]# service smb restart Shutting down SMB services: [FAILED] Shutting down NMB services: [FAILED] Starting SMB services: [ OK ] Starting NMB services: [ OK ] (重启成功)
6、windows下映射网络驱动器: