随笔 - 137  文章 - 1  trackbacks - 0
<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用链接

留言簿

随笔分类

随笔档案

收藏夹

调试技巧

搜索

  •  

最新评论

阅读排行榜

评论排行榜

LINUX samba配置共享文件目录

 

1.使用rpm -qa|grep samba 查看是否安装samba

 

samba-winbind-clients-3.5.4-68.el6.x86_64

samba-3.5.4-68.el6.x86_64

samba-client-3.5.4-68.el6.x86_64

samba-common-3.5.4-68.el6.x86_64

已安装

2.更改/etc/samba/smb.conf配置

 

C代码
  1. [global] 
  2.     dos charset = cp936 
  3.     display charset = UTF-8 
  4.     workgroup = MYGROUP 
  5.     server string = Samba Server Version %v 
  6.     log file = /var/log/samba/log.%m 
  7.     max log size = 50 
  8.     cups options = raw 
  9.  
  10. [homes] 
  11.     comment = Home Directories 
  12.     read only = No 
  13.     browseable = No 
  14.  
  15. [printers] 
  16.     comment = All Printers 
  17.     path = /var/spool/samba 
  18.     printable = Yes 
  19.     browseable = No 
  20.  
  21. [tools] 
  22.     comment = tools 
  23.     path = /tools 
  24.     read only = No 
  25.     guest ok = Yes 
  26.  
  27. [home] 
  28.     comment = User Directory 
  29.     path = /home/%U 
  30.     read only = No 
[global] 	dos charset = cp936 	display charset = UTF-8 	workgroup = MYGROUP 	server string = Samba Server Version %v 	log file = /var/log/samba/log.%m 	max log size = 50 	cups options = raw  [homes] 	comment = Home Directories 	read only = No 	browseable = No  [printers] 	comment = All Printers 	path = /var/spool/samba 	printable = Yes 	browseable = No  [tools] 	comment = tools 	path = /tools 	read only = No 	guest ok = Yes  [home] 	comment = User Directory 	path = /home/%U 	read only = No

添加smb访问用户smbpasswd -a root

 

3.重启service smb restart

4.如果windows下登录samba服务器后无法访问linux下共享目录,提示没有权限。

则检查

 

a、确保linux下防火墙关闭或者是开放共享目录权限

 

b、确保samba服务器配置文件smb.conf设置没有问题,可网上查阅资料看配置办法  

c、确保setlinux关闭,可以用setenforce 0命令执行。 默认的,SELinux禁止网络上对Samba服务器上的共享目录进行写操作,即使你在smb.conf中允许了这项操作。       /usr/bin/setenforce 修改SELinux的实时运行模式  

setenforce 1 设置SELinux 成为enforcing模式

setenforce 0 设置SELinux 成为permissive模式  

如果要彻底禁用SELinux 需要在/etc/sysconfig/selinux中设置参数selinux=0 ,或者在/etc/grub.conf中添加这个参数

  /usr/bin/setstatus -v  

 

 

 

posted on 2018-08-16 17:09 长戟十三千 阅读(842) 评论(0)  编辑 收藏 引用 所属分类: 编程技巧随笔

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理