1、安装samba服务
[[email protected]_80 samba]# yum -y install samba #安装samba
[[email protected]_80 samba]# rpm -qa |grep samba #查看是否已安装 samba-winbind-clients-3.6.9-164.el6.x86_64 samba4-libs-4.0.0-58.el6.rc4.x86_64 samba-winbind-3.6.9-164.el6.x86_64 samba-3.6.9-164.el6.x86_64 samba-client-3.6.9-164.el6.x86_64 samba-common-3.6.9-164.el6.x86_64
2、设置samba服务开机自启
[[email protected]_80 samba]# service smb start
启动 SMB 服务:
[[email protected]_80 samba]# chkconfig smb on
[[email protected]_80 samba]# chkconfig --list smb
smb 0:关闭1:关闭2:启用3:启用4:启用5:启用6:关闭
3、客户端简单测试连接
[[email protected]_84 ~]# smbclient -L 192.168.3.80
Enter root‘s password:
Anonymous login successful
Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.6.9-164.el6]
Sharename Type Comment
--------- ---- -------
IPC$ IPC IPC Service (Samba Server Version 3.6.9-164.el6)
Anonymous login successful
Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.6.9-164.el6]
Server Comment
--------- -------
Workgroup Master
--------- -------
4、配置文件
[printers] #共享名
comment =AllPrinters #描述
path =/var/spool/samba #共享目录或文件绝对路径
browseable = no #是否允许查看此共享内容,
guest ok = no
writable = no
printable = yes
public = yes #是否允许匿名访问
valid users = 用户名或@组名 #谁能访问此共享
readonly = yes #是否只能读取,no标示可以读写
writble = yes #允许写入,no标示不能写入,只读
write list = 用户名或@组名 #标示有写入权限的用户或组
时间: 2024-11-14 18:17:40