傻瓜式配置samba服务

系统:CentOS7,root用户 身份  

文件权限:无需用户名,任何人可访问

 

1、安装samba                     

  •  yum -y install samba

2、查看安装状态        

  • rpm -qa | grep samba

   查看SMB服务状态    

  • service smb status

3、启动SMB服务

  •  systemctl  start smb nmb
  •  systemctl status smb

4、创建共享目录并更改文件夹权限

  • mkdir /public
  • chmod 777 /public
  • chmod 777 /

5、添加samba账户    

  • smbpasswd -a root   (将存在的系统用户添加进去)

补充:      

      查看samba账户    pdbedit -L      

       删除samba账户   pdbedit -x username

       添加用户       pdbedit -a usernamete

6、配置文件smb.conf

  • vi  /etc/samba/smb.conf

   

[global]

workgroup = WORKGROUP

passdb backend = tdbsam

printing = cups

printcap name = cups

printcap cache time = 750

cups options = raw

map to guest = Bad User

include = /etc/samba/dhcp.conf

logon path = \\%L\profiles\.msprofile

logon home = \\%L\%U\.9xprofile

logon drive = P:

usershare allow guests = Yes

  

[homes]

comment = Home Directories

valid users = %S, %D%w%S

browseable = No

read only = No

inherit acls = Yes  

  

[public]

comment = test smb

path = /pubic

           browseable = yes

           read only = no

           writable = yes

           public = yes

(最后一段是定义的文件夹,path是共享路径,[public]是共享名,comment是描述)

7、重启samba服务   每次修改完必须重启

  • service smb restart
  • service smb status

8、测试配置文件smb.conf是否正确     

  • testparm

9、windows上验证

打开计算机——地址栏输入服务器地址(//ip/共享名)

//xx.xx.xx.xx/public

10、映射网络驱动器

我的电脑——菜单栏“映射网络驱动器”——逐步完成

 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值