CentOS7 搭建 Samba 无密码登录

临时关闭防火墙:

systemctl stop firewalld.service

setenforce 0

 

开始安装

yum -y install samba samba-client samba-common

 

修改文件打开数

vi /etc/security/limits.conf
最后添加
* soft nofile 65535
* hard nofile 65535
(需重启机器)

 

vim /etc/samba/smb.conf

[global]
workgroup = SAMBA
netbios name=Vma
security = user
map to guest = Bad User

[my]
comment = my test
path = /data/www/share
browseable = yes
writable = yes
guest ok = yes

#samba v4.1.1版本不支持share和server

 

测试配置文件

testparm

 

防火墙

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

firewall-cmd --reload

 

配置Selinux

chcon -t samba_share_t /data/www/share

 

启动SAMBA

systemctl restart smb #重启
systemctl enable smb #修改为开机启动
systemctl status smb #查看状态

 

测试:

smbclient -L 127.0.0.1

 

在windows下输入\\192.168.49.200访问

 

posted @ 2017-10-14 20:28  luckc#  阅读(2783)  评论(0)    收藏  举报