环境:CentOS 6.8
###安装samba程序包 [root@nod1 ~]#yum install samba -y #给samba增加授权用户,新增的samba用户必须是系统中已经存在的用户 #################################### [root@nod1 ~]# smbpasswd -a gentoo New SMB password: Retype new SMB password: Added user gentoo. [root@nod1 ~]# smbpasswd -a centos New SMB password: Retype new SMB password: Added user centos. [root@nod1 ~]# smbpasswd -a ubuntu New SMB password: Retype new SMB password: Added user ubuntu. #编辑配置文件 ####################################### [root@nod1 ~]# vim /etc/samba/smb.conf [global] workgroup = MYGROUP server string = Samba Server Version %v security = user passdb backend = tdbsam load printers = yes cups options = raw hosts allow = 172.16.0. #host白名单 [shared] #共享名 comment = my samba path = /data #共享的本地目录 public = no valid users = gentoo,centos,ubuntu #允许访问的用户 read list = ubuntu #读权限的用户 write list = centos,gentoo #读写权限的用户 writable = yes printable = no #启动服务 ######################################### [root@nod1 ~]# service nmb start 启动 NMB 服务: [确定] [root@nod1 ~]# service smb start 启动 SMB 服务: [确定] ##连接samba共享存储: smbclient //172.16.100.5/shared -U centos
本文出自 “我所有的向往” 博客,请务必保留此出处http://iittiljw.blog.51cto.com/5575563/1899235
原文:http://iittiljw.blog.51cto.com/5575563/1899235