Chinaunix首页 | 论坛 | 博客
  • 博客访问: 228314
  • 博文数量: 57
  • 博客积分: 1149
  • 博客等级: 少尉
  • 技术积分: 584
  • 用 户 组: 普通用户
  • 注册时间: 2011-10-29 11:35
文章分类

全部博文(57)

文章存档

2016年(1)

2014年(1)

2013年(2)

2012年(27)

2011年(26)

分类: LINUX

2011-11-01 13:46:46

安装SAMBA服务需要4个安装包

samba-client

samba

samba-common

samba-swat

然后配置/etc/samba/smb.conf

主要分配为global,homes-家目录的分享设定,printers-打印机分享

[global]

workgroup = workgroup   工作组

server string = 显示的电脑名称

log file = 事件文档

max log size =50 记录档最大50KB

sercurity = user 身份验证

[homes]

browseable = no 家目录分享 默认禁止

writable = yes 允许对自己目录写入功能

[printers]

path = /var/spool/samba

browseable = no 默认看不到打印机

printeable = yes 表示打印机分享

对共享目录的设定

pubilc 是否允许guest 用户

browsable 默认可以看到分享的资源

writable 默认设置没有写入权限

printable 默认是分享目录

*************************************************

举例分享一个目录 /smbdata

1. Workgroup = WORKGROUP

2.share name = myshare

3.Not Writable

4.Not allow anonymous access

5. Access this shared directory as smbuser1

配置/etc/samba/smb.conf 末尾加入:

[myshare]

path = /smbdata

pubilc = no

writable = no

printable = no

建立 mkdir /smbdata 目录

在目录中建立hello.sh

添加账户 useradd smbuser1

重启SMB服务

在不设置SELINUX的情况下,WINDOWS电脑是无法访问SAMBA的

所以要对SELINUX做一下设置,或者关闭SELINUX

允许用户登录SAMBA后使用家目录:

setsebool -P samba_enable_home_dirs=1

允许SAMBA共享一个文件夹:

chcon -t samba_share_t /smbdata

阅读(1428) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~