----------------------------
第一部分:编译安装
----------------------------
1.解压
# tar xvzf samba-3.3.3.tar.gz
2.配置
#cd cd /test/samba-3.3.3/source/ --test为保存samba压缩文件的目录
#./configure --prefix=/usr/local/samba --with-acl-support
By default, `make install' will install all the files in
`/usr/local/samba/bin', `/usr/local/samba/lib'
3.编译
#make
4.安装
#make install
默认将samba安装到/usr/local/samba中。
5.复制samba配置文件样例到//usr/local/samba/lib下
# pwd
/test/samba-3.3.3/examples
# cp smb.conf.default /usr/local/samba/lib/smb.conf
6.新建需要的目录
#mkdir /etc/samba
7.链接smb配置文件
#ln -s /usr/local/samba/lib/smb.conf /etc/samba
8.建议备份smb.conf配置文件
#mkdir /backup
#cp /usr/local/samba/lib/smb.conf /backup
----------------------------------------------------------------------
第二部分:实验配置
----------------------------------------------------------------------
【案例说明】
1、所有员工都能够在公司内流动办公,但不管在哪台电脑上工作,都要把自己的文件数据保存在samba文件服务器上。
2、市场部,技术部都各有自己的目录,同一个部门的人共同拥有一个共享目录,其他部门的人都只能访问在服务器上自己个人的home目录。
3、所有用户都不允许使用服务器上的shell。
【案例分析】
1、需要samba作为文件服务器,为所有用户创建账号和目录,用户默认都在服务器上有一个home目录,只有认证通过才能看到。
2、需为市场部和技术部创建不同的组sales和tech,并且分配目录,把所有市场部员工加入sales组,技术部员工加入tech组,通过samba共享sales和tech
3、建立用户账号时,不分配shell
(1).编辑smb.conf,设置安全级别为user级别。默认情况下就是user安全级别
security = user
smb passwd file=/etc/samba/smbpasswd
(2)建立市场部sales和技术部tech的组与用户,并加入用户到相应组,禁止登陆shell
#groupadd sales
#groupadd tech
#useradd -g sales -s /bin/false wind
#useradd -g sales -s /bin/false snow
#useradd -g tech -s /bin/false mary
#useradd -g tech -s /bin/false tiger
(3)新建ITG组和用户,并加入到对应的组,禁止登陆shell
#groupadd ITG
#useradd -g ITG -s /bin/false scott
#useradd -g ITG -s /bin/false silver
(4)批量添加用户为samba用户,并设置密码。这里默认为123
#cd /usr/local/samba
#for user in wind snow mary tiger scott silver
do
smbpasswd -a $user
done
New SMB password:
Retype new SMB password:
startsmbfilepwent_internal: file /etc/samba/smbpasswd did not exist. File successfully created.
Added user wind.
New SMB password:
Retype new SMB password:
Added user snow.
New SMB password:
Retype new SMB password:
Added user mary.
New SMB password:
Retype new SMB password:
Added user tiger.
New SMB password:
Retype new SMB password:
Added user scott.
New SMB password:
Retype new SMB password:
Added user silver.
(5)建立组共享文件夹并设置权限
#mkdir /home/sales /home/tech
#chgrp sales /home/sales
#chgrp tech /home/tech
#chmod 770 /home/sales
#chmod 770 /home/tech
#chmod g+s /home/sales
#chmod g+s /home/tech
(6)变价smb.conf,添加共享文件夹并做对应设置
#vi /etc/samba/smb.conf
[sales]
path=/home/sales
comment=sales
public=no
valid users=@sales
write list=@sales
create mask=0770
directory mask=0770
[tech]
path=/home/tech
comment=tech
public=no
valid users=@tech
write list=@tech
create mask=0770
directory mask=0770
(7)启动samba
#/usr/local/samba/sbin/nmbd -D
#/usr/local/samba/sbin/smbd -D
/***********************
常见错误:
/usr/local/samba/sbin/nmbd: error while loading shared libraries: libtalloc.so.1: cannot open shared object file: No such file or directory
# vi /etc/ld.so.conf
或则
#echo "/usr/local/samba/lib " >>/etc/ld.so.conf
在该文件后添加如下内容:
/usr/local/samba/lib
#ldconfig
*******************************/
(8)将samba添加到启动脚本,实现开机自动启动samba服务
#echo "/usr/local/samba/sbin/nmbd -D" >>/etc/rc.d/rc.local
#echo "/usr/local/samba/sbin/smbd -D" >>/etc/rc.d/rc.local
#cat /usr/local/samba/var/log.smbd
#cat /usr/local/samba/var/log.nmbd
[2009/04/09 12:50:55, 0] smbd/server.c:main(1267)
smbd version 3.3.3 started.
Copyright Andrew Tridgell and the Samba Team 1992-2009
[2009/04/09 12:50:55, 0] param/loadparm.c:lp_do_parameter(7230)
Global parameter smb passwd file found in service section!
(9)建立测试文件
# ls /home/sales/
# cat >/home/sales/s.txt
hello, welcome to sales public department!
# ls /home/tech/
# cat >/home/tech/t.txt
hello, here is tech location!
(10)只是允许某些IP能访问
hosts allow = 192.168.11.1 192.168.11.2
分享到:
相关推荐
Samba-4.1.14服务器安装和配置 http://www.2cto.com/os/201408/327930.html 【Linux笔记】sambav4.1.9源码安装及基本使用说明 http://blog.sina.com.cn/s/blog_627617bf0101s4ps.html samba4.1.6源代码部署及...
详细的安装方法和源文件参见下载文件.
samba版本4.4.9和4.10.16的rpm以及4.4.9编译版本
ubuntu20.04无网安装samba 自我安装成功,如有缺依赖,可能还需要再下载其他的依赖包
在aix上安装samba
linux下samba安装rpm包,其中包含: samba-2.2.7a-7.9.0.i386.rpm, samba-client-2.2.7a-7.9.0.i386.rpm, samba-common-2.2.7a-7.9.0.i386.rpm 全套三个安装包... 已经做好了镜像文件,直接加载即可。
本文主要介绍了samba存在的前因后果,已经对samba进行简要介绍;并介绍了samba在ubuntu下安装,samba服务器端配置以及如何在window7共享samba服务器。最后,总结了samba的使场景。
ubuntu下,解压后执行./install.sh即可完成安装,映射路径在/etc/samba/smb.conf中,默认的samba密码见install.sh脚本
高通QCA9563编译,Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件,由服务器及客户端程序构成。
ubuntu10.10下安装Samba步骤,个人实践记载所得。
在solaris上安装samba 1.、手册; 2、脚本和工具;
linux下通过源代码安装samba服务器
samba服务器的安装,在红帽子上安装步骤非常明细
Samba服务器的安装与启动 01 02 03 04 05 06 自动加载Samba服务的设置 Samba服务的重启与重新加载 Samba服务的启动与停止 安装Samba服务 查询系统是否安装Samba相关软件包 目录 04 05 06 准备工作 准备工作: Centos...
这个文件中包含 libwbclient-4.1.17-1.fc20.i686 samba-4.1.17-1.fc20.i686 samba-client-4.1.17-1.fc20.i686 samba-common-4.1.17-1.fc20.i686 samba-libs-4.1.17-1.fc20.i686
53-嵌入式交叉编译环境搭建(4)--Samba服务器设置.pdf 学习资料 复习资料 教学资源
主要介绍在linux和windows server中搭建samba服务
Ubuntu 上建立samba服务器以及交叉编译环境配置
在安装samba主程序时,系统总是出错
ubuntu中通过安装samba服务器,实现在windows系统通过网络驱动器访问ubuntu系统