CentOS7安装配置Samba

转载自:https://www.howtoforge.com/samba-server-installation-and-configuration-on-centos-7


First I will explain the methodology to install the samba with the anonymous sharing. To install samba run,

yum install samba samba-client samba-common
Now to configure samba edit the file  /etc/samba/smb.conf before making changes I will make the backup of original file as  /etc/samba/smb.conf.bak

mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
Further give the entries like this
vi /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 ============================== 
[Anonymous]
path = /samba/anonymous
browsable =yes
writable = yes
guest ok = yes
read only = no
mkdir -p /samba/anonymous
systemctl enable smb.service
systemctl enable nmb.service
systemctl restart smb.service
systemctl restart nmb.service
Further CentOS 7.0 Firewall-cmd will block the samba access, to get rid of that we will run:

firewall-cmd --permanent --zone=public --add-service=samba
firewall-cmd --reload
Now you can access the Centos 7.0 sharing in windows as follows, go to the Run prompt

From a windows machine just browse the folder and try to create a text file, but you will get an error of permission denied.

Check the permission for the shared folder.

To allow anonymous user give the permissions as follows:

cd /samba
chmod -R 0755 anonymous/
chown -R nobody:nobody anonymous/

Further, we need to allow the SELinux for the samba configuration as follows:

chcon -t samba_share_t anonymous/

Now anonymous user can browse & create the folder contents.




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值