- 电脑系统:macOS Sierrabash
- 系统:虚拟化软件Vagrant based on Centos7.2服务器
[root@localhost vagrant]# cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core)
[root@localhost vagrant]# yum install samba -y
- 安装完成以后,按照需求设置配置文件,文件位于/etc/samba/smb.conf。less
此处的"global"中配置应用默认设置,需新增"share"段。spa
[global] workgroup = SAMBA security = user passdb backend = tdbsam printing = cups printcap name = cups load printers = yes cups options = raw [share] path=/data available=yes browseable=yes public=yes writable=yes
- 设置中"share - path"的目录要设置相应的权限,不然会出现不能访问的状况。vagrant
“sherry” 为自行设置的usernamecode
[root@localhost vagrant]# touch /etc/samba/smbpasswd [root@localhost vagrant]# smbpasswd -a sherry New SMB password: Retype new SMB password:
- 查看samba服务的状态。ip
[root@localhost vagrant]# smbstatus
- rpm软件包管理器查看samba被包含在哪些包里。虚拟机
[root@localhost vagrant]# rpm -ql samba | less /etc/openldap/schema /etc/openldap/schema/samba.schema /etc/pam.d/samba /usr/bin/eventlogadm /usr/bin/smbstatus /usr/lib/systemd/system/nmb.service /usr/lib/systemd/system/smb.service /usr/lib64/samba/auth /usr/lib64/samba/auth/script.so
能够看出smb.service是用systemd启动的;it
- 使服务自动启动io
[root@localhost vagrant]# systemctl enable smb.service
- 查看服务状态
[root@localhost vagrant]# systemctl status smb.service
正常配置在这里就能够了,由于个人虚拟机还没有配置公共IP,因此这里须要多一些操做,你们能够略过此步。
。。。待续