- 论坛徽章:
- 0
|
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 |
|