点击(此处)折叠或打开
- 1.[root@samba ~]# uname -a //查看内核版本详细信息,包括主机名称
- Linux samba 2.6.18-308.el5 #1 SMP Tue Feb 21 20:06:06 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
- 2.[root@samba ~]# lsb_release -a //查看系统的发行版本及厂商
- LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
- Distributor ID: CentOS
- Description: CentOS release 5.8 (Final)
- Release: 5.8
- Codename: Final
二、首先安装与samba相关的三个数据包,如果用rpm安装不上,有依赖关系的话,那就直接用yum 安装即可。
1.检查一下与 samba 相关的三个数据包是否已经安装成功
点击(此处)折叠或打开
- [root@samba ~]# yum install -y samba*
- [root@samba ~]# rpm -qa | grep samba
- samba-common-3.0.33-3.39.el5_8
- samba-swat-3.0.33-3.39.el5_8
- samba-3.0.33-3.39.el5_8 //samba:这个套件主要包含了 SAMBA 的主要 daemon档案 ( smbd 及 nmbd )、 SAMBA 的文件档 ( document )、以及其它与 SAMBA 相关的logrotate 设定文件及开机预设选项档案等。
- samba-client-3.0.33-3.39.el5_8 //这个套件则提供了当 Linux 做为SAMBA Client 端时,所需要的工具指令,例如挂载 SAMBA 档案格式的执行档 smbmount等。
点击(此处)折叠或打开
- [root@samba samba]# ll /etc/samba/
- total 32
- -rw-r--r-- 1 root root 20 May 18 2012 lmhosts
- -rw-r--r-- 1 root root 9733 May 118 2012 smb.conf
- -rw-r--r-- 1 root root 97 May 118 2012 smbusers
- [root@samba samba]# grep -v "^[#;]" smb.conf | grep -v "^$"
- [global]
- workgroup = MYGROUP
- server string = Samba Server Version %v
- # logs split per machine
- # max 50KB per log file, then rotate
- security = user
- passdb backend = tdbsam
- # the login script name depends on the machine name
- # the login script name depends on the unix user used
- # disables profiles support by specifing an empty path
- load printers = yes
- cups options = raw
- #obtain list of printers automatically on SystemV
- [homes]
- comment = Home Directories
- browseable = no
- writable = yes
- [printers]
- comment = All Printers
- path = /var/spool/samba
- browseable = no
- guest ok = no
- writable = no
- printable = yes
点击(此处)折叠或打开
- [root@samba samba]# cat smb.conf
- [global]
- workgroup = MYGROUP
- server string = Samba Server Version %v
- log file = /var/log/samba/%m.log
- hosts allow = 127. 192.168.1. 192.168.13.
- # logs split per machine
- # max 50KB per log file, then rotate
- security = share
- passdb backend = tdbsam
- # the login script name depends on the machine name
- # the login script name depends on the unix user used
- # disables profiles support by specifing an empty path
- load printers = yes
- cups options = raw
- #obtain list of printers automatically on SystemV
- [homes]
- comment = Home Directories
- browseable = no
- writable = yes
- [printers]
- comment = All Printers
- path = /var/spool/samba
- browseable = no
- guest ok = no
- writable = no
- printable = yes
- [beyond]
- comment = Public share with beyond file
- path = /var/public/beyond
- public = yes
- read only = yes
- [root@samba ~]# useradd tt1
- [root@samba ~]# useradd tt2
- [root@samba ~]# smbpasswd -a tt1
- New SMB password:
- Retype new SMB password:
- Added user tt1.
- [root@samba ~]# smbpasswd -a tt2
- New SMB password:
- Retype new SMB password:
- Added user tt2.
- [root@samba ~]# smbpasswd -a root
- New SMB password:
- Retype new SMB password:
- Added user root.
- [root@samba samba]# head smb.conf
- [global]
- workgroup = WORKGROUP
- server string = Samba Server Version %v
- log file = /var/log/samba/%m.log
- hosts allow = 127. 192.168.1. 192.168.13.
- # logs split per machine
- # max 50KB per log file, then rotate
- security = user
- passdb backend = tdbsam
- # the login script name depends on the machine name
- [root@samba samba]# tail smb.conf
- read only = yes
- [taokey]
- comment = Public share with taokey files
- path = /var/public/taokey
- public = no
- writable = yes
- valid users = tt1,tt2 @root
- writelist = root,tt2
- directory mask = 0744
- create mask = 0600
- [root@samba samba]# mkdir -p /var/public/taokey
- [root@samba samba]# mkdir -p /var/public/taokey/test
- [root@samba samba]# touch /var/public/taokey/taoyake.txt
6.输入之前创建的tt1账号和密码,可以登陆进去
- [root@samba samba]# tail smb.conf
- read only = yes
- [taokey]
- comment = Public share with taokey files
- path = /var/public/taokey
- public = no
- writable = yes
- valid users = tt1,tt2 @root
- writelist = root,tt2
- directory mask = 0744
- create mask = 0600
相关热门文章
给主人留下些什么吧!~~
评论热议