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配置
- [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
[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
长戟十三千 阅读(995)
评论(0) 编辑 收藏 引用 所属分类:
编程技巧随笔