CentOS7共享資料夾配置

最近公司設計伺服器更換為CentOS,很不幸,IT部門給安裝的CentOS7,Samba服務按照之前用的rhel6.8進行配置,結果共享失敗.
終於,找到了這篇,試了試,竟然成功了.

本文來源:http://www.blogjava.net/nkjava/archive/2015/08/01/426542.html

1、安装
yum install samba samba-client samba-common -y
這項,我已經安裝了.
2、配置
备份已有配置
mv /etc/samba/smb.conf /etc/samba/smb.conf.bkp
添加新的配置
vim /etc/samba/smb.conf
输入以下内容

[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = centos
security = user
map to guest = bad user
dns proxy = no
#============================ Share Definitions ============================== 
[Public]
path = /data/share/
writable = yes
browsable = yes
guest ok = yes
guest only = yes
create mode = 0777
directory mode = 0777

配置启动服务

mkdir -p /data/share/public
systemctl enable smb.service
systemctl enable nmb.service
systemctl restart smb.service
systemctl restart nmb.service

设置防火墙

firewall-cmd --permanent --zone=public --add-service=samba
firewall-cmd --reload

修改目录访问权限

chmod -R 0755 public
chown -R nobody:nobody public

关闭selinux,这里不做描述了3、试用
windows里在运行里输入:\ip address
即可访问

共有 0 条评论

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *