|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
欢迎大家来到仓酷云论坛!1、samba办事器的装置与设置
[root@localhost~]#yum-yinstallsambasamba-commonsamba-clientsamba办事器所需的软件包
[root@localhost~]#vim/etc/samba/smb.confsamba办事器的主设置文件
[global]
#-----------------------NetworkRelatedOptions-------------------------
workgroup=MYGROUP事情组称号,可任意写
serverstring=MYSambaServerVersion%v办事器形貌,可任意写
;netbiosname=MYSERVER
;inte***ces=loeth0192.168.12.2/24192.168.13.2/24这两条相称于samba办事器特有的防火墙机制
;hostsallow=127.192.168.12.192.168.13.
#---------------------------LoggingOptions-----------------------------
logfile=/var/log/samba/log.%msamba的日记文件及定名格局
#max50KBperlogfile,thenrotate
maxlogsize=50最年夜日记存储量
#-----------------------StandaloneServerOptions------------------------
security=user会见samba的用户级别(share/user/domain)
passdbbackend=tdbsam
#---------------------------PrintingOptions-----------------------------
loadprinters=no是不是启用打印机功效,默许为yes
cupsoptions=raw
;printcapname=/etc/printcap
#obtainlistofprintersautomaticallyonSystemV
;printcapname=lpstat
;printing=cups
#---------------------------FilesystemOptions---------------------------
[homes]在客户端显现的同享目次称号
comment=homesdirectory此同享目次形貌
browseable=no不在客户端显现同享目次(即不显现[homes])
writable=no不成写
readonly=yes可读取
createmode=0664samba用户在本人家目次(默许/home/sambauser)下新建文件的默许权限为0644(0为acl权限)
directorymode=0775samba用户在本人家目次(默许/home/sambauser)下新建目次的默许权限为0775(0为acl权限)
[printers]打印功效同享目次
comment=AllPrinters
path=/var/spool/samba
browseable=no
guestok=no
writable=no
printable=yes
#----------------------------userpublicoptions-------------------------
[wxwsmb]办事器同享目次称号
comment=userpublicdirectory
path=/tmp/public实践的同享目次相对路径
browseable=yes
writable=yes
readonly=yes
public=yes能够同享
writelist=@wxwsmb能够同享此目次的samba用户组
[root@localhost~]#servicesmbrestart
封闭SMB办事:[断定]
启动SMB办事:[断定]
[root@localhost~]#servicenmbrestart
封闭NMB办事:[断定]
启动NMB办事:[断定]
[root@localhost~]#netstat-ltunp|grepsmb检察收集端口的监控形态
tcp000.0.0.0:1390.0.0.0:*LISTEN1507/smbd
tcp000.0.0.0:4450.0.0.0:*LISTEN1507/smbd
tcp00:::139:::*LISTEN1507/smbd
tcp00:::445:::*LISTEN1507/smbd
2、创立samba用户
[root@localhost~]#groupaddwxwsmb
[root@localhost~]#useradd-gwxwsmbsmb2
[root@localhost~]#pdbedit-a-usmb2创立samba用户
newpassword:
retypenewpassword:
Unixusername:smb2
NTusername:
AccountFlags:[U]
UserSID:S-1-5-21-1442997883-3833565404-3457035396-1002
PrimaryGroupSID:S-1-5-21-1442997883-3833565404-3457035396-513
3、测试(办事器ip地点为192.168.1.24)
1、linux操纵体系测试
[root@localhost~]#smbclient-L//192.168.1.24-Usmb2
Entersmb2spassword:
Domain=[MYGROUP]OS=[Unix]Server=[Samba3.6.9-164.el6]
SharenameTypeComment
--------------------
wxwsmbDiskuserpublicdirectory
IPC$IPCIPCService(MYSambaServerVersion3.6.9-164.el6)
smb2Diskhomesdirectory
[root@localhost~]#mount-tcifs//192.168.1.24/smb2/mnt-ousername=smb2
Password:输出设定的samba用户暗码
[root@localhost~]#df-h
FilesystemSizeUsedAvailUse%Mountedon
/dev/sda249G5.8G40G13%/
tmpfs398M0398M0%/dev/shm
/dev/sda1194M28M157M15%/boot
//192.168.1.24/smb249G5.8G40G13%/mnt
4、注重事项:
1、记得将防火墙(也能够将防火墙开启经由过程制订划定规矩来使办事器与客户端通讯)和selinux封闭;
2、同享目次开放的权限要跟目次自己的权限分歧才干到达想要的你想要的效果。
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们! |
|