Centos5下构建samba服务及相关配置_第1页
Centos5下构建samba服务及相关配置_第2页
Centos5下构建samba服务及相关配置_第3页
Centos5下构建samba服务及相关配置_第4页
Centos5下构建samba服务及相关配置_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、centos5下构建samba服务及相关配置1.在线安装sambarootccntos5yum y install sambarootccntos5 rpm -qa |grep samba samba-common-3. 0. 33-3. 7. el5_3. 1samba-3. 0. 33-3. 7. el5_3. 12: /etc/samba目录下找不到smbpasswd文件的解决方法rootcentos5is /etc/samba/imhosts passdb. tdb secrets.tdb smb. conf smbusers主要是因为samba服务启用了 tdbsam验证,注释掉相应

2、的配置 rootccntos5grep -r passdb /ctc/samba/smb. conf#passdbbackend=tdbsam;passdbbackend=tdbsam;passdbbackend二tdbsam添加一行 smb passwd filerootcentos5grep -r /zsmb passwd f订e /etc/samba/smb. confsmb passwd file = /etc/samba/smb. confrootcentos5、# /etc/rc. d/init. d/smb reload重新载入smb. conf文 件:确定rootcentos5

3、 '# useradd yangrootcentos5 、# smbpasswd -a yangnew smb password:retype new smb password:startsmbfilepwent_internal: file /etc/samba/smbpasswd did not exist.file successfully crcated.added user yang.rootcentos5 is /etc/samba/imhosts passdb. tdb secrets, tdb smb. conf smbpasswd smbusers rootcento

4、s5 、# cat /etc/samba/smbpasswdyang:501:ccf9155e3e7db453aad3b435b51404ee:3dbde697d71690a769204beb122 83678:u:lct-49847b4f:rootcentos5 、# 1s /var/1og/samba/cores nmbd. log smbd. log3:查看相关的日志信息rootcentos5 cat /var/log/samba/nmbd. log2009/02/01 00:09:19, 0 nmbd/nmbd. c:main (724)netbios nameserver versi

5、on 3.0. 33一3.7. el5_3.1 started.copyright andrew tridgel1 and the samba team 1992-2008 2009/02/01 00:15:01, 0nmbd/nmbdbecomelmb c:become_local_master_stage2 (396)six six six six sixsamba name server cent0s5 is now a local master browser for workgroup mygroup on subnet 192.168.0.200ztx ztx ztxrootcen

6、tos5 # tail -f /var/log/samba/smbd. log2009/02/01 00:11:12, 1 smbd/service, c:make connection snum(1033) naruto-pc (192. 168. 0. 2) connect to service yang initially as user yang (uid=501, gid=501) (pid 2635)2009/02/01 00:11:29, 1 smbd/service, c:closc_cnum(1230) naruto-pc (192.168.0.2) closed conne

7、ction to service yang 4:新建一个所有人都可以读取但不能写入的共享目录,适用用内部网络常用软 件的共享rootcentos5、# tail -5 /etc/samba/smb. conf | grep -v ; | grep -v *softwarecomment = z,software downloadpath = /usr/local/srcread only = yesrootcentos5 重新载入smb. conf 件:确定rootccntos5public = yes service smb reload文touch /usr/local/src/msql.

8、 tar. gz5:给技术部新建一个共享目录,只有技术部的员工才能访问该目录,且除 techl用户夕卜,所有tech组的用户都只有读取的权限,适用于独立的部门文 档资料等共享。rootcentos5 # tail -7 /etc/samba/smb. conf igrep -v 八;“techcomment 二 tech group docpath = /home/techread only 二 yes public 二 novalid users 二 ©tech write list 二 techllrootcentos5rootcentos5rootccntos5rootccnt

9、os5groupadd tech、# useradd -g tech techl uscradd -g tech tech2 "# tail -2 /ctc/passwd techl:x:502:502:/home/techl:/bin/bash tech2:x:503:502:/home/tech2:/bin/bash rootcentos5 grep tech /etc/group tech:x:502:rootcentos5cat /etc/samba/smbpasswdyang:501:ccf9155e3e7db453aad3b435b51404ee:3dbde697d716

10、90a769204beb12283678:u:lct-498477d6:techl: 502 :ccf9155e3e7i)b453aad3b435b51404ee:3dbde697i)71690a769204beb12 283678:u:lct-49847fc9:tech2:503:ccf9155e3e7db453aad3b435b51404ee:3dbde697d71690a769204beb12283678:u:lct-49847fcf:rootcentos5service smb reload重新载入smb. conf文件:确定rootccntos5 mkdir /home/techro

11、otcentos5 touch /home/tech/source.txtrootcentos5 11 -d /home/techdrwxr-xr-x 2 root root 4096 02-01 00:47 /home/tech rootcentos5 # chmod -r 777 /home/tech6:新建一个所有人都可以读取和写入,可以删除自己的文件,但不能删除其他 人文件的共享目录,适用用公司内部的公用资料共享等rootcentos5tail -6/ctc/samba/smb. conf |grep -vpubliccomment = "public directory77

12、path 二 /home/publicpublic 二 yeswrite able = yescreate mask = 0755rootcentos5mkdir /home/publicrootccntos5chmod -r 777 /home/public/rootcentos5 service smb reload重新载入smb. conf文件:确定7:前面的共享都需要输入用户名和密码,即使是那些公用的共享,也只能在输 入了合法用户名和密码之后才能使用共享,这样对于公用共享目录的访问来说 不太方便,下面就來建立一个不需要用户名和密码就能访问公用共享口录,而其他的非公用口录是需 要输入密码

13、才能访问的配置文件,同时注销掉samba用户的home i录 rootcentos5 useradd -s /bin/false narutorootcentos5 grep -r naruto /etc/samba/smb. confguest account 二 narutorootcentos5 grep -r ,zbad user" /etc/samba/smb. confmap to guest 二 bad user#homes# comment = home directories# browseable = no# writable = yes;valid users

14、二 %s;valid users 二 mydomatn%srootcentos5 service smb reload重新载入smb. conf文件:确定rootcentos5tail -f /var/log/samba/smbd. log2009/07/22 06:41:40, 1 smbd/service. c:make_connection_snum仃033) naruto-pc (192. 168. 0. 2) cormect to service public initially as user naruto (uid二511, gid二511) (pid 2997)2009/07/

15、22 06:41:55, 1 smbd/service. c:close_cnum(1230)naruto-pc (192.168.0.2) closed connection to service public 2009/07/22 06:43:0& 1 smbd/service, c:makc_conncction_snum(1033) naruto-pc (192.168.0.2) connect to service public initially as user naruto (uid=511, gid=511) (pid 3002)2009/07/22 06:43:24,

16、 1 smbd/service, c:close cnum(1230) 8: samba默认使用的是和系统账户同名的samba账号,这也就意味着当知道了 samba的账号之后,也就知道了服务器中存在着这个同名的系统账号,因而服 务器的安全性下降了许多rootcentos5、# grep -r /z us er name map /etc/samba/smb. conf username map 二 /etc/samba/smbusersrootcentos5 # cat /etc/samba/smbusers# unix_name 二 smb_name1 smb_name2root = adm

17、inistrator adminnobody = guest pcguest smbguesttechl = delphirootcentos5tail -f/var/log/samba/smbdlog 2009/07/22 06:41:40, 1 smbd/service c:make_connection_snum(1033) naruto-pc (192168 0.2) connect to service public initially as user naruto (uid二511, gid=511) (pid 2997)2009/07/22 06:41:55, 1 smbd/service c:close_cnum(1230) naruto一pc (192168 0 2) closed connection to service public2009/07/22 06:43:08, 1 smbd/service c:make_connection_snum(1033) naruto-pc (192168 0.2) connect to service public initially as user naruto (uid=511, gid=511) (pid 3002)2009/07/22

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论