免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 944 | 回复: 0
打印 上一主题 下一主题

linux下的samba简单配置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-08-30 13:07 |只看该作者 |倒序浏览
   samba是连接unix系统和windows系统的桥梁.
   我习惯把公司一些重要的数据都存放在linux操作系统上的.公司的员工用的都是Windows操作系统.
服务器我用的还是老的redhat 9,装了好几年的,没出什么问题.也就懒的去升级了.
   在安装系统的时候把,把SMB的软件包安装上.系统安装完毕后进去图形界面,在服务里面把smb这个服务
前面打勾.然后保存.
   samba的一些简单配置:
   samba的配置文件在/etc/samba/这个文件夹中.
   先介绍一下smb帐号的建立,用useradd增加一个帐号
   再用smbadduser这个命令增加smb的帐号
  [root@localhost /]# cd /etc/samba
  [root@localhost samba]# ls
  lmhosts  secrets.tdb  smb.conf  smbpasswd  smbusers
  我们开始编辑smb.conf这个文件夹.
  我们以建立一个叫test的文件夹来举例子.并这个文件夹只有test能编辑其他人只能看.
我们建立2个smb的帐号,叫test和test1
[root@localhost home]# mkdir test      在/home下建立一个叫test的文件夹
[root@localhost home]# cd /etc/samba   
[root@localhost samba]# vi smb.conf    编辑
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not made any basic syntactic errors.
#
#======================= Global Settings =====================================
[global]
        log file = /var/log/samba/%m.log
        smb passwd file = /etc/samba/smbpasswd
        load printers = yes
        passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
        obey pam restrictions = yes
        username map = /etc/samba/smbusers
        encrypt passwords = yes
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not made any basic syntactic errors.
#
#======================= Global Settings =====================================
[global]
        log file = /var/log/samba/%m.log
        smb passwd file = /etc/samba/smbpasswd
        load printers = yes
        passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
        obey pam restrictions = yes
        username map = /etc/samba/smbusers
        encrypt passwords = yes
        passwd program = /usr/bin/passwd %u
        dns proxy = no
        server string = Samba Server
        printing = cups
        unix password sync = yes
        workgroup = MYGROUP
        os level = 20
        printcap name = /etc/printcap
        max log size = 0
        pam password change = yes
上面是smb.conf的基本配置.
我们在smb.conf的最后面插入下面几条.
        [TEST]                            这个是共享出来的文件夹的名字
        valid users = test,test1          这个是那些能访问的帐号的名单
        writeable = yes                   是否可以用smb帐号编辑
        path = /home/test                 这个是路径
好了这样我们建立好一个共享文件夹了.简单吧.
最后把smb服务重起一下:/etc/rc.d/init.d/smb restart




:)我写文章的能力其实是非常非常的差.大家不要见笑.

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/26553/showart_371108.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP